diff options
author | obrien <obrien@FreeBSD.org> | 1997-03-30 10:50:01 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 1997-03-30 10:50:01 +0000 |
commit | 843afab4134c62fe1163235f7493f95300ddff42 (patch) | |
tree | 249c9b3a0fb809fdf3c55daf87e25523f563ef45 /contrib/cpio | |
parent | f1b528304001b70c39e0129bc85f5e9001f622b3 (diff) | |
download | FreeBSD-src-843afab4134c62fe1163235f7493f95300ddff42.zip FreeBSD-src-843afab4134c62fe1163235f7493f95300ddff42.tar.gz |
Don't set the umask until after we have processed the arguments
and opened the archive file. This allows "cpio -o -O output_file"
to create the output file with the callers proper umask.
Closed PR# 1391
Add setlocale LC_ALL (from ache).
Diffstat (limited to 'contrib/cpio')
-rw-r--r-- | contrib/cpio/main.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/contrib/cpio/main.c b/contrib/cpio/main.c index 76125f0..bba4d32 100644 --- a/contrib/cpio/main.c +++ b/contrib/cpio/main.c @@ -23,6 +23,12 @@ #include <getopt.h> #include <sys/types.h> #include <sys/stat.h> +#ifdef HAVE_SYS_PARAM_H +#include <sys/param.h> +#endif +#if (defined(BSD) && (BSD >= 199306)) +#include <locale.h> +#endif #include "filetypes.h" #include "system.h" #include "cpiohdr.h" @@ -498,7 +504,10 @@ main (argc, argv) char *argv[]; { program_name = argv[0]; - umask (0); + +#if (defined(BSD) && (BSD >= 199306)) + (void) setlocale (LC_ALL, ""); +#endif #ifdef __TURBOC__ _fmode = O_BINARY; /* Put stdin and stdout in binary mode. */ @@ -509,6 +518,7 @@ main (argc, argv) #endif process_args (argc, argv); + umask (0); initialize_buffers (); |