diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2001-06-28 23:02:09 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2001-06-28 23:02:09 +0000 |
commit | 64e55bf47b27fa7c7a225f41dc46770807d76896 (patch) | |
tree | 8f97c95e8e42b10293fd3b8d8a4cbd8f307ec2aa /sys/posix4 | |
parent | e8f7a95298fc2309fa48391c83795adefa3903dd (diff) | |
download | src-64e55bf47b27fa7c7a225f41dc46770807d76896.tar.gz src-64e55bf47b27fa7c7a225f41dc46770807d76896.zip |
Remove a fascinating but confusing construct involving chaining
conditional clauses in the following way:
(0 || a || b);
No functional change.
Notes
Notes:
svn path=/head/; revision=78944
Diffstat (limited to 'sys/posix4')
-rw-r--r-- | sys/posix4/p1003_1b.c | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/sys/posix4/p1003_1b.c b/sys/posix4/p1003_1b.c index 7ae378daa95c..b0d8bc5b15db 100644 --- a/sys/posix4/p1003_1b.c +++ b/sys/posix4/p1003_1b.c @@ -173,13 +173,12 @@ int sched_setparam(struct proc *p, if (e) return (e); - (void) (0 - || (e = p31b_proc(p, uap->pid, &p)) - || (e = ksched_setparam(&p->p_retval[0], ksched, p, - (const struct sched_param *)&sched_param)) - ); - - return e; + e = p31b_proc(p, uap->pid, &p); + if (e) + return (e); + e = ksched_setparam(&p->p_retval[0], ksched, p, + (const struct sched_param *)&sched_param); + return (e); } int sched_getparam(struct proc *p, @@ -188,15 +187,15 @@ int sched_getparam(struct proc *p, int e; struct sched_param sched_param; - (void) (0 - || (e = p31b_proc(p, uap->pid, &p)) - || (e = ksched_getparam(&p->p_retval[0], ksched, p, &sched_param)) - ); - - if (!e) - copyout(&sched_param, uap->param, sizeof(sched_param)); + e = p31b_proc(p, uap->pid, &p); + if (e) + return (e); + e = ksched_getparam(&p->p_retval[0], ksched, p, &sched_param); + if (e) + return (e); - return e; + e = copyout(&sched_param, uap->param, sizeof(sched_param)); + return (e); } int sched_setscheduler(struct proc *p, struct sched_setscheduler_args *uap) @@ -208,25 +207,25 @@ int sched_setscheduler(struct proc *p, if (e) return (e); - (void) (0 - || (e = p31b_proc(p, uap->pid, &p)) - || (e = ksched_setscheduler(&p->p_retval[0], - ksched, p, uap->policy, - (const struct sched_param *)&sched_param)) - ); + e = p31b_proc(p, uap->pid, &p); + if (e) + return (e); + e = ksched_setscheduler(&p->p_retval[0], ksched, p, uap->policy, + (const struct sched_param *)&sched_param); - return e; + return (e); } int sched_getscheduler(struct proc *p, struct sched_getscheduler_args *uap) { int e; - (void) (0 - || (e = p31b_proc(p, uap->pid, &p)) - || (e = ksched_getscheduler(&p->p_retval[0], ksched, p)) - ); - return e; + e = p31b_proc(p, uap->pid, &p); + if (e) + return (e); + e = ksched_getscheduler(&p->p_retval[0], ksched, p); + + return (e); } int sched_yield(struct proc *p, struct sched_yield_args *uap) @@ -250,13 +249,12 @@ int sched_rr_get_interval(struct proc *p, { int e; - (void) (0 - || (e = p31b_proc(p, uap->pid, &p)) - || (e = ksched_rr_get_interval(&p->p_retval[0], ksched, - p, uap->interval)) - ); + e = p31b_proc(p, uap->pid, &p); + if (e) + return (e); + e = ksched_rr_get_interval(&p->p_retval[0], ksched, p, uap->interval); - return e; + return (e); } #endif |