(main): Use proper mode_t types and macros.
authorJim Meyering <jim@meyering.net>
Mon, 26 Apr 1999 13:03:49 +0000 (13:03 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 26 Apr 1999 13:03:49 +0000 (13:03 +0000)
Don't assume the traditional Unix values for mode bits.

src/dd.c

index 4e8a380..eebd214 100644 (file)
--- a/src/dd.c
+++ b/src/dd.c
@@ -1049,7 +1049,10 @@ main (int argc, char **argv)
 
       if (seek_record == 0 && !(conversions_mask & C_NOTRUNC))
        omode |= O_TRUNC;
-      output_fd = open (output_file, omode, 0666);
+      output_fd = open (output_file, omode,
+                       (S_IRUSR | S_IWUSR
+                        | S_IRGRP | S_IWGRP
+                        | S_IROTH | S_IWOTH));
       if (output_fd < 0)
        error (1, errno, "%s", output_file);
 #if HAVE_FTRUNCATE