[haiku-commits] r36356 - haiku/trunk/src/system/libroot/posix/sys

  • From: korli@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 19 Apr 2010 19:12:44 +0200 (CEST)

Author: korli
Date: 2010-04-19 19:12:44 +0200 (Mon, 19 Apr 2010)
New Revision: 36356
Changeset: http://dev.haiku-os.org/changeset/36356/haiku
Ticket: http://dev.haiku-os.org/ticket/5759

Modified:
   haiku/trunk/src/system/libroot/posix/sys/utimes.c
Log:
* fixed utimensat() when times is NULL, both the access and modification 
timestamps should be set (bug #5759).
* the meaning of AT_SYMLINK_NOFOLLOW was also reversed.


Modified: haiku/trunk/src/system/libroot/posix/sys/utimes.c
===================================================================
--- haiku/trunk/src/system/libroot/posix/sys/utimes.c   2010-04-19 16:29:23 UTC 
(rev 36355)
+++ haiku/trunk/src/system/libroot/posix/sys/utimes.c   2010-04-19 17:12:44 UTC 
(rev 36356)
@@ -54,6 +54,7 @@
                bigtime_t now = real_time_clock_usecs();
                stat.st_atim.tv_sec = stat.st_mtim.tv_sec = now / 1000000;
                stat.st_atim.tv_nsec = stat.st_mtim.tv_nsec = (now % 1000000) * 
1000;
+               mask |= B_STAT_ACCESS_TIME | B_STAT_MODIFICATION_TIME;
        }
 
        if (times != NULL) {
@@ -84,7 +85,7 @@
 
        // set the times -- as per spec we even need to do this, if both have
        // UTIME_OMIT set
-       status = _kern_write_stat(fd, path, (flag & AT_SYMLINK_NOFOLLOW) != 0,
+       status = _kern_write_stat(fd, path, (flag & AT_SYMLINK_NOFOLLOW) == 0,
                &stat, sizeof(struct stat), mask);
 
        RETURN_AND_SET_ERRNO(status);


Other related posts: