diff options
author | netchild <netchild@FreeBSD.org> | 2006-10-08 17:08:27 +0000 |
---|---|---|
committer | netchild <netchild@FreeBSD.org> | 2006-10-08 17:08:27 +0000 |
commit | 4e02401696800412c7ef181b4030bf6710d739ac (patch) | |
tree | 2023eca664cc1613a543a57374038517b2d6dcb5 /sys/compat/linux/linux_misc.c | |
parent | 3605ec17e550b7ced754ff7fbf923e90829dc155 (diff) | |
download | FreeBSD-src-4e02401696800412c7ef181b4030bf6710d739ac.zip FreeBSD-src-4e02401696800412c7ef181b4030bf6710d739ac.tar.gz |
- Replace homegrown check for FIFO with S_ISFIFO. [1]
- Check the status of the options before messing with it.
Inspired by: NetBSD [1]
Submitted by: rdivacky
Tested with: LTP
Diffstat (limited to 'sys/compat/linux/linux_misc.c')
-rw-r--r-- | sys/compat/linux/linux_misc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 9631ac2..12db81a 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -795,6 +795,12 @@ linux_waitpid(struct thread *td, struct linux_waitpid_args *args) printf(ARGS(waitpid, "%d, %p, %d"), args->pid, (void *)args->status, args->options); #endif + /* + * this is necessary because the test in kern_wait doesnt + * work because we mess with the options here + */ + if (args->options &~ (WUNTRACED|WNOHANG|WCONTINUED)) + return (EINVAL); options = (args->options & (WNOHANG | WUNTRACED)); /* WLINUXCLONE should be equal to __WCLONE, but we make sure */ @@ -880,7 +886,7 @@ linux_mknod(struct thread *td, struct linux_mknod_args *args) printf(ARGS(mknod, "%s, %d, %d"), path, args->mode, args->dev); #endif - if (args->mode & S_IFIFO) + if (S_ISFIFO(args->mode)) error = kern_mkfifo(td, path, UIO_SYSSPACE, args->mode); else error = kern_mknod(td, path, UIO_SYSSPACE, args->mode, |