X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fmount_image.c;h=fa7594b7b0efb38f1428f87d7ea349df28d4a363;hp=7bede83da5026abd01e202c0e0f62e970d441511;hb=7923b5c8b25946a0a85779c3bc6fc75bd96a76b3;hpb=9f9d3eb4bb33782c66d52b825bb84578f74de817 diff --git a/src/mount_image.c b/src/mount_image.c index 7bede83d..fa7594b7 100644 --- a/src/mount_image.c +++ b/src/mount_image.c @@ -47,6 +47,7 @@ #include #include #include +#include #ifdef ENABLE_XATTR #include @@ -1012,13 +1013,11 @@ struct msg_handler_context { int timeout_seconds; union { struct { - /*bool unmount_complete;*/ pid_t daemon_pid; int mount_flags; int status; } unmount; struct { - /*int unmount_flags;*/ struct wimfs_context *wimfs_ctx; } daemon; }; @@ -1172,17 +1171,12 @@ static int unmount_timed_out_cb(struct msg_handler_context *handler_ctx) if (handler_ctx->unmount.daemon_pid == 0) { goto out_crashed; } else { - errno = 0; kill(handler_ctx->unmount.daemon_pid, 0); if (errno == ESRCH) { goto out_crashed; - } else if (errno != 0) { - ERROR_WITH_ERRNO("Error determining state of " - "filesystem daemon"); - return WIMLIB_ERR_MQUEUE; } else { DEBUG("Filesystem daemon is still alive... " - "Waiting another %d seconds", + "Waiting another %d seconds\n", handler_ctx->timeout_seconds); return 0; } @@ -1240,11 +1234,12 @@ static int receive_message(mqd_t mq, struct msg_handler_context *handler_ctx, mailbox_size, NULL, &timeout); hdr = mailbox; if (bytes_received == -1) { - ERROR_WITH_ERRNO("mq_timedreceive()"); - if (errno == ETIMEDOUT) + if (errno == ETIMEDOUT) { ret = WIMLIB_ERR_TIMEOUT; - else + } else { + ERROR_WITH_ERRNO("mq_timedreceive()"); ret = WIMLIB_ERR_MQUEUE; + } } else if (bytes_received < sizeof(*hdr) || bytes_received != hdr->msg_size) { ret = WIMLIB_ERR_INVALID_UNMOUNT_MESSAGE;