[BACK]Return to savecore.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sbin / savecore

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sbin/savecore/savecore.c between version 1.64 and 1.65

version 1.64, 2004/07/14 07:26:12 version 1.65, 2004/10/16 03:48:15
Line 149  void Write(int, void *, int);
Line 149  void Write(int, void *, int);
 int  int
 main(int argc, char *argv[])  main(int argc, char *argv[])
 {  {
         int ch, level;          int ch, level, testonly;
         char *ep;          char *ep;
   
         dirname = NULL;          dirname = NULL;
         kernel = NULL;          kernel = NULL;
         level = 1;              /* default to fastest gzip compression */          level = 1;              /* default to fastest gzip compression */
           testonly = 0;
         gzmode[0] = 'w';          gzmode[0] = 'w';
   
         openlog("savecore", LOG_PERROR, LOG_DAEMON);          openlog("savecore", LOG_PERROR, LOG_DAEMON);
   
         while ((ch = getopt(argc, argv, "cdfN:vzZ:")) != -1)          while ((ch = getopt(argc, argv, "cdfnN:vzZ:")) != -1)
                 switch(ch) {                  switch(ch) {
                 case 'c':                  case 'c':
                         clear = 1;                          clear = 1;
Line 171  main(int argc, char *argv[])
Line 172  main(int argc, char *argv[])
                 case 'f':                  case 'f':
                         force = 1;                          force = 1;
                         break;                          break;
                   case 'n':
                           testonly = 1;
                           break;
                 case 'N':                  case 'N':
                         kernel = optarg;                          kernel = optarg;
                         break;                          break;
Line 192  main(int argc, char *argv[])
Line 196  main(int argc, char *argv[])
         argc -= optind;          argc -= optind;
         argv += optind;          argv += optind;
   
         if (argc != (clear ? 0 : 1))          if (argc != ((clear || testonly) ? 0 : 1))
                 usage();                  usage();
   
         gzmode[1] = level + '0';          gzmode[1] = level + '0';
Line 206  main(int argc, char *argv[])
Line 210  main(int argc, char *argv[])
         (void)time(&now);          (void)time(&now);
         kmem_setup();          kmem_setup();
   
         if (clear) {          if (clear && !testonly) {
                 clear_dump();                  clear_dump();
                 exit(0);                  exit(0);
         }          }
Line 214  main(int argc, char *argv[])
Line 218  main(int argc, char *argv[])
         if (!dump_exists() && !force)          if (!dump_exists() && !force)
                 exit(1);                  exit(1);
   
           if (testonly)
                   /* If -n was passed and there was a dump, exit at level 0 */
                   exit(0);
   
         check_kmem();          check_kmem();
   
         if (panicstr)          if (panicstr)
Line 794  void
Line 802  void
 usage(void)  usage(void)
 {  {
         (void)syslog(LOG_ERR,          (void)syslog(LOG_ERR,
             "usage: savecore [-cfvz] [-N system] [-Z level] directory");              "usage: savecore [-cfnvz] [-N system] [-Z level] directory");
         exit(1);          exit(1);
 }  }

Legend:
Removed from v.1.64  
changed lines
  Added in v.1.65

CVSweb <webmaster@jp.NetBSD.org>