]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Formatting and Clean Up 1783/head
authorW. Felix Handte <w@felixhandte.com>
Thu, 12 Sep 2019 20:27:05 +0000 (16:27 -0400)
committerW. Felix Handte <w@felixhandte.com>
Thu, 12 Sep 2019 20:27:05 +0000 (16:27 -0400)
programs/util.c

index 3e4c3335fba802d0b2a7ea7fe305390961492a12..3988295d45bb1bab7d2378734247ac6957833e6d 100644 (file)
@@ -54,22 +54,24 @@ int UTIL_getFileStat(const char* infilename, stat_t *statbuf)
 int UTIL_setFileStat(const char *filename, stat_t *statbuf)
 {
     int res = 0;
-#if defined(_WIN32) || (PLATFORM_POSIX_VERSION < 200809L)
-    struct utimbuf timebuf;
-#else
-    /* (atime, mtime) */
-    struct timespec timebuf[2] = { {0, UTIME_NOW}, statbuf->st_mtim };
-#endif
 
     if (!UTIL_isRegularFile(filename))
         return -1;
 
+    /* set access and modification times */
 #if defined(_WIN32) || (PLATFORM_POSIX_VERSION < 200809L)
-    timebuf.actime = time(NULL);
-    timebuf.modtime = statbuf->st_mtime;
-    res += utime(filename, &timebuf);  /* set access and modification times */
+    {
+        struct utimbuf timebuf;
+        timebuf.actime = time(NULL);
+        timebuf.modtime = statbuf->st_mtime;
+        res += utime(filename, &timebuf);
+    }
 #else
-    res += utimensat(AT_FDCWD, filename, timebuf, 0);  /* set access and modification times */
+    {
+        /* (atime, mtime) */
+        struct timespec timebuf[2] = { {0, UTIME_NOW}, statbuf->st_mtim };
+        res += utimensat(AT_FDCWD, filename, timebuf, 0);
+    }
 #endif
 
 #if !defined(_WIN32)