]> wimlib.net Git - wimlib/blobdiff - src/mount_image.c
Annotate yet another unaligned memory access
[wimlib] / src / mount_image.c
index 1133ad7d36ec71e037d97ac712746604fcd07ba7..2daebba317bf90f22c57125668d7f94580b84a51 100644 (file)
@@ -594,7 +594,7 @@ inode_to_stbuf(const struct wim_inode *inode,
        stbuf->st_mtime = wim_timestamp_to_unix(inode->i_last_write_time);
        stbuf->st_ctime = stbuf->st_mtime;
 #endif
-       stbuf->st_blocks = (stbuf->st_size + 511) / 512;
+       stbuf->st_blocks = DIV_ROUND_UP(stbuf->st_size, 512);
        return 0;
 }
 
@@ -1144,7 +1144,7 @@ commit_image(struct wimfs_context *ctx, int unmount_flags, mqd_t mq)
        return wimlib_overwrite(ctx->wim, write_flags, 0);
 }
 
-/* In the case of an allow_other mount, only the owner and root should be
+/* In the case of an allow_other mount, only the mount owner and root are
  * allowed to unmount the filesystem.  */
 static bool
 may_unmount_wimfs(void)
@@ -2100,7 +2100,7 @@ wimlib_mount_image(WIMStruct *wim, int image, const char *dir,
        if (mount_flags & WIMLIB_MOUNT_FLAG_READWRITE) {
                if (!wim->filename)
                        return WIMLIB_ERR_NO_FILENAME;
-               ret = can_delete_from_wim(wim);
+               ret = can_modify_wim(wim);
                if (ret)
                        return ret;
        }
@@ -2435,7 +2435,7 @@ do_unmount_commit(const char *dir, int unmount_flags,
                ret = do_unmount(dir);
        if (progfunc) {
                /* Terminate the progress thread.  */
-               char empty[0];
+               char empty[1];
                mq_send(mq, empty, 0, 1);
                pthread_join(commit_progress_tid, NULL);
        }