From da211f5bf658a2015c36b3e9462f6d5dd97f3dd6 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Sun, 26 Dec 1999 13:04:52 +0000 Subject: [PATCH] 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). --- sys/kern/sys_pipe.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index de2399ec6e87..b82f91d5e6dd 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -63,6 +63,7 @@ #include #include #include +#include #include #include @@ -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,