X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fuse%2Fguestmount.c;h=05cacef0fec775c1afd286f7fbba06d731d77783;hb=60d020d363ec49a547fe047ac2f9bd88c8efcd5c;hp=ba0d626ca66ce1276f95258907555bb1adf22d49;hpb=336275ee6dbff5efa2152a4f67ef354b81d15d59;p=libguestfs.git diff --git a/fuse/guestmount.c b/fuse/guestmount.c index ba0d626..05cacef 100644 --- a/fuse/guestmount.c +++ b/fuse/guestmount.c @@ -534,14 +534,22 @@ fg_utimens (const char *path, const struct timespec ts[2]) time_t mtsecs = ts[1].tv_sec; long mtnsecs = ts[1].tv_nsec; +#ifdef UTIME_NOW if (atnsecs == UTIME_NOW) atnsecs = -1; +#endif +#ifdef UTIME_OMIT if (atnsecs == UTIME_OMIT) atnsecs = -2; +#endif +#ifdef UTIME_NOW if (mtnsecs == UTIME_NOW) mtnsecs = -1; +#endif +#ifdef UTIME_OMIT if (mtnsecs == UTIME_OMIT) mtnsecs = -2; +#endif r = guestfs_utimens (g, path, atsecs, atnsecs, mtsecs, mtnsecs); if (r == -1) @@ -620,14 +628,8 @@ fg_read (const char *path, char *buf, size_t size, off_t offset, if (size > limit) size = limit; - /* Note the correct error handling here is tricky, because in the - * case where the call returns a zero-length buffer, it might return - * NULL. However it won't adjust rsize along the error path, so we - * can set rsize to something beforehand and use that as a flag. - */ - rsize = 1; r = guestfs_pread (g, path, size, offset, &rsize); - if (rsize == 1 && r == NULL) + if (r == NULL) return error (); /* This should never happen, but at least it stops us overflowing