File: stat_round.patch

package info (click to toggle)
hurd 1%3A0.9.git20251029-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 37,160 kB
  • sloc: ansic: 539,358; sh: 5,143; asm: 2,998; makefile: 2,303; perl: 589; pascal: 484; awk: 157
file content (57 lines) | stat: -rw-r--r-- 1,704 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
This is not a proper fix, discussed on
http://lists.gnu.org/archive/html/bug-hurd/2009-02/msg00002.html
but not finished, last mail on
http://lists.gnu.org/archive/html/bug-hurd/2009-04/msg00006.html

We should support i_ctime_extra/i_mtime_extra/i_atime_extra anyway.

---
 libdiskfs/file-utimes.c |    4 ++--
 libdiskfs/node-times.c  |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

--- a/libdiskfs/file-utimes.c
+++ b/libdiskfs/file-utimes.c
@@ -33,6 +33,7 @@ diskfs_S_file_utimes (struct protid *cre
 			 else
 			   {
 			     np->dn_stat.st_atim = atime;
+			     np->dn_stat.st_atim.tv_nsec = 0;
 			     np->dn_set_atime = 0;
 			   }
 			 
@@ -42,6 +42,7 @@ diskfs_S_file_utimes (struct protid *cre
 			 else
 			   {
 			     np->dn_stat.st_mtim = mtime;
+			     np->dn_stat.st_mtim.tv_nsec = 0;
 			     np->dn_set_mtime = 0;
 			   }
 			 
--- a/libdiskfs/node-times.c
+++ b/libdiskfs/node-times.c
@@ -53,21 +53,21 @@ diskfs_set_node_times (struct node *np)
   if (np->dn_set_mtime)
     {
       np->dn_stat.st_mtim.tv_sec = t.tv_sec;
-      np->dn_stat.st_mtim.tv_nsec = t.tv_usec * 1000;
+      np->dn_stat.st_mtim.tv_nsec = 0;
       np->dn_stat_dirty = 1;
       np->dn_set_mtime = 0;
     }
   if (np->dn_set_atime)
     {
       np->dn_stat.st_atim.tv_sec = t.tv_sec;
-      np->dn_stat.st_atim.tv_nsec = t.tv_usec * 1000;
+      np->dn_stat.st_atim.tv_nsec = 0;
       np->dn_stat_dirty = 1;
       np->dn_set_atime = 0;
     }
   if (np->dn_set_ctime)
     {
       np->dn_stat.st_ctim.tv_sec = t.tv_sec;
-      np->dn_stat.st_ctim.tv_nsec = t.tv_usec * 1000;
+      np->dn_stat.st_ctim.tv_nsec = 0;
       np->dn_stat_dirty = 1;
       np->dn_set_ctime = 0;
     }