]> git.wh0rd.org - dump.git/blobdiff - dump/main.c
Use OPEN() instead of open() for toc files.
[dump.git] / dump / main.c
index b73a7887012475bfdd86f4953e5c0110679f59cb..74ca0be0d72aaa9adf9721087bccb1e60f26b5e1 100644 (file)
@@ -37,7 +37,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: main.c,v 1.94 2004/07/05 15:12:45 stelian Exp $";
+       "$Id: main.c,v 1.96 2009/07/23 09:34:07 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
 #endif /* not lint */
 
 #include <config.h>
@@ -239,6 +239,8 @@ main(int argc, char *argv[])
                quit("TP_BSIZE must be a multiple of DEV_BSIZE\n");
        memset(&lastlevel, 0, NUM_STR_SIZE);
        memset(&level, 0, NUM_STR_SIZE);
                quit("TP_BSIZE must be a multiple of DEV_BSIZE\n");
        memset(&lastlevel, 0, NUM_STR_SIZE);
        memset(&level, 0, NUM_STR_SIZE);
+       /* Default dump level is zero. */
+       level[0] = '0';
 
        if (argc < 2)
                usage();
 
        if (argc < 2)
                usage();
@@ -541,7 +543,7 @@ main(int argc, char *argv[])
        }
 
        (void)setuid(getuid()); /* rmthost() is the only reason to be setuid */
        }
 
        (void)setuid(getuid()); /* rmthost() is the only reason to be setuid */
-       if (Apath && (Afile = open(Apath, O_WRONLY|O_CREAT|O_TRUNC,
+       if (Apath && (Afile = OPEN(Apath, O_WRONLY|O_CREAT|O_TRUNC,
                                   S_IRUSR | S_IWUSR | S_IRGRP |
                                   S_IWGRP | S_IROTH | S_IWOTH)) < 0) {
                msg("Cannot open %s for writing: %s\n",
                                   S_IRUSR | S_IWUSR | S_IRGRP |
                                   S_IWGRP | S_IROTH | S_IWOTH)) < 0) {
                msg("Cannot open %s for writing: %s\n",