@@ -2,7 +2,9 @@
#include <fcntl.h>
#include <inttypes.h>
#include <stdio.h>
+#include <sys/stat.h>
#include <sys/syscall.h>
+#include <unistd.h>
struct linux_dirent {
unsigned long d_ino;
@@ -1380,6 +1380,7 @@ static int mcast_send (PAL_HANDLE handle, int offset, int size,
return -PAL_ERROR_CONNFAILED;
case EAGAIN:
handle->hdr.flags &= ~WRITEABLE(1);
+ /* fallthrough */
default:
return unix_to_pal_error(ERRNO(bytes));
}
@@ -325,7 +325,7 @@ int open_memdevice (pid_t pid, int * memdev, struct enclave_dbginfo ** ei)
if (nmemdevs == sizeof(memdevs) / sizeof(memdevs[0]))
return -ENOMEM;
- struct enclave_dbginfo eib;
+ struct enclave_dbginfo eib = { .pid = -1 };
long int res;
for (int off = 0 ; off < sizeof(eib) ; off += sizeof(long int)) {
@@ -1398,6 +1398,7 @@ static int64_t mcast_send (PAL_HANDLE handle, uint64_t offset, uint64_t size,
HANDLE_HDR(handle)->flags &= ~WRITEABLE(1);