summaryrefslogtreecommitdiff
path: root/sys/kern/sys_pipe.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-11-28 15:19:44 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-11-28 15:19:44 +0000
commit4f3e51a13a43b7dc337181c12858aa89b1f6c5c7 (patch)
tree4043f997fddb714e78427bb76b74ccf52d12b315 /sys/kern/sys_pipe.c
parentcb1713ecb598caffdad2ac379d48781f67be6f3a (diff)
When updating the timestamps on pipes, use getnanotime() instead of more
accurate but more expensive nanotime(), the loss of precision shouldn't matter. Inspired from the other *BSD which did a similar change. ok tedu@ millert@ henning@ deraadt@
Diffstat (limited to 'sys/kern/sys_pipe.c')
-rw-r--r--sys/kern/sys_pipe.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index bb1985c8dec..9a74beabf2d 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_pipe.c,v 1.52 2007/08/07 11:30:53 millert Exp $ */
+/* $OpenBSD: sys_pipe.c,v 1.53 2007/11/28 15:19:43 miod Exp $ */
/*
* Copyright (c) 1996 John S. Dyson
@@ -211,7 +211,7 @@ pipe_create(struct pipe *cpipe)
if (error != 0)
return (error);
- nanotime(&cpipe->pipe_ctime);
+ getnanotime(&cpipe->pipe_ctime);
cpipe->pipe_atime = cpipe->pipe_ctime;
cpipe->pipe_mtime = cpipe->pipe_ctime;
cpipe->pipe_pgid = NO_PID;
@@ -353,7 +353,7 @@ pipe_read(struct file *fp, off_t *poff, struct uio *uio, struct ucred *cred)
pipeunlock(rpipe);
if (error == 0)
- nanotime(&rpipe->pipe_atime);
+ getnanotime(&rpipe->pipe_atime);
unlocked_error:
--rpipe->pipe_busy;
@@ -589,7 +589,7 @@ retrywrite:
}
if (error == 0)
- nanotime(&wpipe->pipe_mtime);
+ getnanotime(&wpipe->pipe_mtime);
/*
* We have something to offer, wake up select/poll.
*/