diff options
author | Matt Kraai | 2001-04-30 16:43:21 +0000 |
---|---|---|
committer | Matt Kraai | 2001-04-30 16:43:21 +0000 |
commit | 43ca13714b4dc720a617ce23f89eb860bfb62303 (patch) | |
tree | 9124d67f06842c2f95bec49b5566193b3f0b2552 | |
parent | 24abecc3490cb419ec9bac79af31f8ded1e3fba7 (diff) | |
download | busybox-43ca13714b4dc720a617ce23f89eb860bfb62303.zip busybox-43ca13714b4dc720a617ce23f89eb860bfb62303.tar.gz |
Simplify permission handling for FIFOs.
-rw-r--r-- | libbb/copy_file.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/libbb/copy_file.c b/libbb/copy_file.c index 062ecb9..b2750cc 100644 --- a/libbb/copy_file.c +++ b/libbb/copy_file.c @@ -184,21 +184,10 @@ int copy_file(const char *source, const char *dest, int flags) return -1; } } else if (S_ISFIFO(source_stat.st_mode)) { - mode_t mode, saved_umask; - saved_umask = umask(0); - - mode = source_stat.st_mode; - if (!(flags & FILEUTILS_PRESERVE_STATUS)) - mode = source_stat.st_mode & ~saved_umask; - mode |= S_IRWXU; - - if (mkfifo(dest, mode) < 0) { - umask(saved_umask); + if (mkfifo(dest, source_stat.st_mode) < 0) { perror_msg("cannot create fifo `%s'", dest); return -1; } - - umask(saved_umask); } else if (S_ISLNK(source_stat.st_mode)) { int size; char buf[BUFSIZ + 1]; |