summaryrefslogtreecommitdiff
path: root/sys/kern/kern_time.c
diff options
context:
space:
mode:
authorSebastien Marie <semarie@cvs.openbsd.org>2015-11-01 19:03:34 +0000
committerSebastien Marie <semarie@cvs.openbsd.org>2015-11-01 19:03:34 +0000
commit68511280041637921c144dadc66364bd3847520e (patch)
tree8837690b527988d8389c4243559c191b02100459 /sys/kern/kern_time.c
parentb249aebdcb012545f1aa7bab683224c46dc508fc (diff)
refactor pledge_*_check and pledge_fail functions
- rename _check function without suffix: a "pledge" function called from anywhere is a "check" function. - makes pledge_fail call the responsability to the _check function. remove it from caller. - make proper use of (potential) returned error of _check() functions. - adds pledge_kill() and pledge_protexec() with and OK deraadt@
Diffstat (limited to 'sys/kern/kern_time.c')
-rw-r--r--sys/kern/kern_time.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index 3aab66ce4d9..674a1c8e092 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_time.c,v 1.94 2015/10/09 01:10:27 deraadt Exp $ */
+/* $OpenBSD: kern_time.c,v 1.95 2015/11/01 19:03:33 semarie Exp $ */
/* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */
/*
@@ -433,8 +433,9 @@ sys_adjtime(struct proc *p, void *v, register_t *retval)
struct timeval atv;
int error;
- if (pledge_adjtime_check(p, delta))
- return (EPERM);
+ error = pledge_adjtime(p, delta);
+ if (error)
+ return error;
if (olddelta) {
memset(&atv, 0, sizeof(atv));