summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1999-12-26 13:04:52 +0000
committerbde <bde@FreeBSD.org>1999-12-26 13:04:52 +0000
commit4397ebaec086a0c76e3381ab0fa8e4bfca692ff0 (patch)
treeaf505566800466c676965081fa847af45c6e2b89 /sys
parent2f7307b35f8aaa38b119fa8cf667cdf4d3cc5ce5 (diff)
downloadFreeBSD-src-4397ebaec086a0c76e3381ab0fa8e4bfca692ff0.zip
FreeBSD-src-4397ebaec086a0c76e3381ab0fa8e4bfca692ff0.tar.gz
Use vfs_timestamp() instead of getnanotime() to set timestamps. This
fixee incoherency of pipe timestamps relative to file timestamps in the usual case where getnanotime() is not used for the latter. (File and pipe timestamps are still incoherent relative to real time unless the vfs_timestamp_precision sysctl is set to 2 or 3).
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/sys_pipe.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index de2399e..b82f91d 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -63,6 +63,7 @@
#include <sys/signalvar.h>
#include <sys/sysproto.h>
#include <sys/pipe.h>
+#include <sys/vnode.h>
#include <sys/uio.h>
#include <vm/vm.h>
@@ -253,7 +254,7 @@ pipeinit(cpipe)
cpipe->pipe_state = 0;
cpipe->pipe_peer = NULL;
cpipe->pipe_busy = 0;
- getnanotime(&cpipe->pipe_ctime);
+ vfs_timestamp(&cpipe->pipe_ctime);
cpipe->pipe_atime = cpipe->pipe_ctime;
cpipe->pipe_mtime = cpipe->pipe_ctime;
bzero(&cpipe->pipe_sel, sizeof cpipe->pipe_sel);
@@ -439,7 +440,7 @@ pipe_read(fp, uio, cred, flags, p)
pipeunlock(rpipe);
if (error == 0)
- getnanotime(&rpipe->pipe_atime);
+ vfs_timestamp(&rpipe->pipe_atime);
unlocked_error:
--rpipe->pipe_busy;
@@ -944,7 +945,7 @@ pipe_write(fp, uio, cred, flags, p)
error = 0;
if (error == 0)
- getnanotime(&wpipe->pipe_mtime);
+ vfs_timestamp(&wpipe->pipe_mtime);
/*
* We have something to offer,
OpenPOWER on IntegriCloud