Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Negative exit code cleanup: Replace exit(-x) with exit(x).



details:   https://anonhg.NetBSD.org/src/rev/7846226f5667
branches:  trunk
changeset: 508124:7846226f5667
user:      wiz <wiz%NetBSD.org@localhost>
date:      Fri Apr 06 11:13:45 2001 +0000

description:
Negative exit code cleanup: Replace exit(-x) with exit(x).
As seen on tech-userlevel.

diffstat:

 crypto/dist/kame/racoon/kmpstat.c             |   2 +-
 dist/bind/bin/dnskeygen/dnskeygen.c           |   4 ++--
 dist/bind/bin/dnsquery/dnsquery.c             |  24 ++++++++++++------------
 dist/bind/lib/dst/bsafe_link.c                |   4 ++--
 dist/cdk/demos/serial.c                       |   2 +-
 dist/cdk/demos/syb.c                          |   6 +++---
 dist/cdk/demos/vinstall.c                     |   8 ++++----
 dist/cdk/examples/vinstall.c                  |   8 ++++----
 dist/ntp/ntpdc/ntpdc.c                        |   4 ++--
 dist/ntp/ntpq/ntpq.c                          |   4 ++--
 dist/ntp/util/tickadj.c                       |   6 +++---
 distrib/pc532/floppies/inst-common/download.c |  16 ++++++++--------
 games/backgammon/teachgammon/teach.c          |   6 +++---
 games/mille/mille.c                           |   6 +++---
 lib/librmt/rmtlib.c                           |   4 ++--
 lib/libskey/skeysubr.c                        |   4 ++--
 libexec/rexecd/rexecd.c                       |   8 ++++----
 sbin/routed/rtquery/rtquery.c                 |   6 +++---
 sys/arch/hpc/stand/libsa/panic.c              |   4 ++--
 sys/arch/hpcmips/stand/libsa/panic.c          |   4 ++--
 sys/netiso/xebec/main.c                       |   6 +++---
 sys/netiso/xebec/sets.c                       |  12 ++++++------
 sys/netkey/key_debug.c                        |   4 ++--
 usr.bin/make/compat.c                         |   8 ++++----
 usr.bin/talk/get_addrs.c                      |  10 +++++-----
 usr.bin/talk/get_names.c                      |  10 +++++-----
 usr.bin/whois/whois.c                         |   6 +++---
 usr.sbin/apmd/apmd.c                          |   4 ++--
 usr.sbin/inetd/inetd.c                        |  12 ++++++------
 usr.sbin/map-mbone/mapper.c                   |   6 +++---
 usr.sbin/mrinfo/mrinfo.c                      |   8 ++++----
 usr.sbin/mrouted/main.c                       |   6 +++---
 usr.sbin/mtrace/mtrace.c                      |  12 ++++++------
 usr.sbin/pim6dd/debug.c                       |   4 ++--
 usr.sbin/pim6sd/debug.c                       |   4 ++--
 usr.sbin/pkg_install/lib/ftpio.c              |   6 +++---
 usr.sbin/pppd/pppd/main.c                     |   6 +++---
 usr.sbin/rip6query/rip6query.c                |   4 ++--
 usr.sbin/route6d/route6d.c                    |  10 +++++-----
 usr.sbin/rpc.lockd/lockd_lock.c               |   4 ++--
 usr.sbin/tcpdump/tcpdump.c                    |   6 +++---
 41 files changed, 139 insertions(+), 139 deletions(-)

diffs (truncated from 1235 to 300 lines):

diff -r feb1735d500a -r 7846226f5667 crypto/dist/kame/racoon/kmpstat.c
--- a/crypto/dist/kame/racoon/kmpstat.c Fri Apr 06 11:10:57 2001 +0000
+++ b/crypto/dist/kame/racoon/kmpstat.c Fri Apr 06 11:13:45 2001 +0000
@@ -233,7 +233,7 @@
        exit(0);
 
     bad:
-       exit(-1);
+       exit(1);
 }
 
 static int
diff -r feb1735d500a -r 7846226f5667 dist/bind/bin/dnskeygen/dnskeygen.c
--- a/dist/bind/bin/dnskeygen/dnskeygen.c       Fri Apr 06 11:10:57 2001 +0000
+++ b/dist/bind/bin/dnskeygen/dnskeygen.c       Fri Apr 06 11:13:45 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dnskeygen.c,v 1.2 2001/01/27 07:21:57 itojun Exp $     */
+/*     $NetBSD: dnskeygen.c,v 1.3 2001/04/06 11:13:53 wiz Exp $        */
 
 #if !defined(lint) && !defined(SABER)
 static const char rcsid[] = "Id: dnskeygen.c,v 1.11 2000/12/23 08:14:31 vixie Exp";
@@ -315,7 +315,7 @@
                printf("\n");
        }
 
-       exit (-3);
+       exit (3);
 }
 
 
diff -r feb1735d500a -r 7846226f5667 dist/bind/bin/dnsquery/dnsquery.c
--- a/dist/bind/bin/dnsquery/dnsquery.c Fri Apr 06 11:10:57 2001 +0000
+++ b/dist/bind/bin/dnsquery/dnsquery.c Fri Apr 06 11:13:45 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dnsquery.c,v 1.2 2001/01/27 07:21:57 itojun Exp $      */
+/*     $NetBSD: dnsquery.c,v 1.3 2001/04/06 11:13:53 wiz Exp $ */
 
 #if !defined(lint) && !defined(SABER)
 static const char rcsid[] = "Id: dnsquery.c,v 8.15 2000/12/23 08:14:32 vixie Exp";
@@ -68,7 +68,7 @@
        /* if no args, exit */
        if (argc == 1) {
                fprintf(stderr, "Usage:  %s [-h] host [-n ns] [-t type] [-c class] [-r retry] [-p period] [-s] [-v] [-d] [-a]\n", argv[0]);
-               exit(-1);
+               exit(1);
        }
 
        /* handle args */
@@ -84,7 +84,7 @@
                case 'h' :      if (strlen(optarg) >= sizeof(name)) {
                                        fprintf(stderr,
                                                "Domain name too long (%s)\n", optarg);
-                                       exit(-1);
+                                       exit(1);
                                } else
                                        strcpy(name, optarg);
                                break;
@@ -98,7 +98,7 @@
                                        class = proto_class;
                                else {
                                    fprintf(stderr, "Bad class (%s)\n", optarg);
-                                       exit(-1);
+                                       exit(1);
                                }
                            }
                                break;
@@ -112,7 +112,7 @@
                                        type = proto_type;
                                else {
                                    fprintf(stderr, "Bad type (%s)\n", optarg);
-                                       exit(-1);
+                                       exit(1);
                                }
                            }
                                break;
@@ -137,7 +137,7 @@
                                                fprintf(stderr,
                                                        "res_ninit() failed\n"
                                                        );
-                                               exit(-1);
+                                               exit(1);
                                }
                                if (nameservers >= MAXNS) break;
                                (void) inet_aton(optarg,
@@ -148,7 +148,7 @@
                                                fprintf(stderr,
                                                       "Bad nameserver (%s)\n",
                                                        optarg);
-                                               exit(-1);
+                                               exit(1);
                                        }
                                        memcpy(&q_nsaddr[nameservers],
                                               q_nsname->h_addr, INADDRSZ);
@@ -160,14 +160,14 @@
 
                default :       fprintf(stderr, 
                                "\tUsage:  %s [-n ns] [-h host] [-t type] [-c class] [-r retry] [-p period] [-s] [-v] [-d] [-a]\n", argv[0]);
-                               exit(-1);
+                               exit(1);
                }
        }
        if (optind < argc) {
                if (strlen(argv[optind]) >= sizeof(name)) {
                        fprintf(stderr,
                                "Domain name too long (%s)\n", argv[optind]);
-                       exit(-1);
+                       exit(1);
                } else {
                        strcpy(name, argv[optind]);
                }
@@ -178,7 +178,7 @@
        if (!(res.options & RES_INIT))
                if (res_ninit(&res) == -1) {
                        fprintf(stderr, "res_ninit() failed\n");
-                       exit(-1);
+                       exit(1);
                }
 
        /* 
@@ -210,13 +210,13 @@
                if (n < 0) {
                        fprintf(stderr, "Query failed (h_errno = %d) : %s\n", 
                                h_errno, h_errlist[h_errno]);
-                       exit(-1);
+                       exit(1);
                }
        } else if ((n = res_nsearch(&res, name, class, type,
                                    answer, len)) < 0) {
                fprintf(stderr, "Query failed (h_errno = %d) : %s\n", 
                        h_errno, h_errlist[h_errno]);
-               exit(-1);
+               exit(1);
        }
        res_pquery(&res, answer, n, stdout);
        exit(0);
diff -r feb1735d500a -r 7846226f5667 dist/bind/lib/dst/bsafe_link.c
--- a/dist/bind/lib/dst/bsafe_link.c    Fri Apr 06 11:10:57 2001 +0000
+++ b/dist/bind/lib/dst/bsafe_link.c    Fri Apr 06 11:13:45 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bsafe_link.c,v 1.2 2001/01/27 07:22:02 itojun Exp $    */
+/*     $NetBSD: bsafe_link.c,v 1.3 2001/04/06 11:13:53 wiz Exp $       */
 
 #if defined(BSAFE) || defined(DNSSAFE)
 static const char rcsid[] = "Header: /proj/cvs/isc/bind8/src/lib/dst/bsafe_link.c,v 1.11 1999/10/13 16:39:22 vixie Exp";
@@ -1050,7 +1050,7 @@
 
        if (digest_obj == NULL || *digest_obj == NULL) {
                printf("NO digest obj\n");
-               exit(-33);
+               exit(33);
        }
 
        if ((mode & SIG_MODE_INIT) &&
diff -r feb1735d500a -r 7846226f5667 dist/cdk/demos/serial.c
--- a/dist/cdk/demos/serial.c   Fri Apr 06 11:10:57 2001 +0000
+++ b/dist/cdk/demos/serial.c   Fri Apr 06 11:13:45 2001 +0000
@@ -107,7 +107,7 @@
    {
       /* Create a pop-up dialog box... */
       printf ("Error: Open of <%s> failed.\n", port);
-      exit (-1);
+      exit (1);
    }
 
    termInfo.c_cflag = CRTSCTS | CLOCAL;
diff -r feb1735d500a -r 7846226f5667 dist/cdk/demos/syb.c
--- a/dist/cdk/demos/syb.c      Fri Apr 06 11:10:57 2001 +0000
+++ b/dist/cdk/demos/syb.c      Fri Apr 06 11:13:45 2001 +0000
@@ -163,7 +163,7 @@
       mesg[0] = "<C></U>Fatal Error";
       mesg[1] = "<C>Could not connect to the Sybase database.";
       popupLabel (GPCdkScreen, mesg, 2);
-      exit (-1);
+      exit (1);
    }
 
    /* Load the history. */
@@ -200,7 +200,7 @@
    {
       destroyCDKScreen (GPCdkScreen);
       endCDK ();
-      exit (-1);
+      exit (1);
    }
 
    /* Do this forever. */
@@ -574,7 +574,7 @@
       mesg[1] = "<C>Could not connect to the Sybase database.";
       popupLabel (screen, mesg, 2);
       refreshCDKScreen (screen);
-      exit (-1);
+      exit (1);
    }
 
   /*
diff -r feb1735d500a -r 7846226f5667 dist/cdk/demos/vinstall.c
--- a/dist/cdk/demos/vinstall.c Fri Apr 06 11:10:57 2001 +0000
+++ b/dist/cdk/demos/vinstall.c Fri Apr 06 11:13:45 2001 +0000
@@ -84,7 +84,7 @@
    if (filename == 0)
    {
       fprintf (stderr, "Usage: %s %s\n", argv[0], FPUsage);
-      exit (-1);
+      exit (1);
    }
 
    /* Open the file list file and read it in. */
@@ -92,7 +92,7 @@
    if (count == 0)
    {
       fprintf (stderr, "%s: Input filename <%s> is empty.\n", argv[0], filename);
-      exit (-1);
+      exit (1);
    }
 
   /*
@@ -191,7 +191,7 @@
       {
         freeChar (fileList[x]);
       }
-      exit (-1);
+      exit (1);
    }
 
   /*
@@ -211,7 +211,7 @@
       {
         freeChar (fileList[x]);
       }
-      exit (-2);
+      exit (2);
    }
 
    /* Create the histogram. */
diff -r feb1735d500a -r 7846226f5667 dist/cdk/examples/vinstall.c
--- a/dist/cdk/examples/vinstall.c      Fri Apr 06 11:10:57 2001 +0000
+++ b/dist/cdk/examples/vinstall.c      Fri Apr 06 11:13:45 2001 +0000
@@ -84,7 +84,7 @@
    if (filename == 0)
    {
       fprintf (stderr, "Usage: %s %s\n", argv[0], FPUsage);
-      exit (-1);
+      exit (1);
    }
 
    /* Open the file list file and read it in. */
@@ -92,7 +92,7 @@
    if (count == 0)
    {
       fprintf (stderr, "%s: Input filename <%s> is empty.\n", argv[0], filename);
-      exit (-1);
+      exit (1);
    }
 
   /*
@@ -191,7 +191,7 @@
       {
         freeChar (fileList[x]);
       }
-      exit (-1);
+      exit (1);
    }
 
   /*
@@ -211,7 +211,7 @@
       {
         freeChar (fileList[x]);
       }
-      exit (-2);
+      exit (2);
    }
 
    /* Create the histogram. */
diff -r feb1735d500a -r 7846226f5667 dist/ntp/ntpdc/ntpdc.c
--- a/dist/ntp/ntpdc/ntpdc.c    Fri Apr 06 11:10:57 2001 +0000
+++ b/dist/ntp/ntpdc/ntpdc.c    Fri Apr 06 11:13:45 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntpdc.c,v 1.3 2000/10/10 12:43:42 itojun Exp $ */
+/*     $NetBSD: ntpdc.c,v 1.4 2001/04/06 11:13:54 wiz Exp $    */
 
 /*
  * ntpdc - control and monitor your ntpd daemon
@@ -448,7 +448,7 @@
        sockfd = socket(AF_INET, SOCK_DGRAM, 0);
        if (sockfd == INVALID_SOCKET) {
                error("socket");
-               exit(-1);
+               exit(1);
        }
 #else
        sockfd = socket(AF_INET, SOCK_DGRAM, 0);
diff -r feb1735d500a -r 7846226f5667 dist/ntp/ntpq/ntpq.c
--- a/dist/ntp/ntpq/ntpq.c      Fri Apr 06 11:10:57 2001 +0000
+++ b/dist/ntp/ntpq/ntpq.c      Fri Apr 06 11:13:45 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntpq.c,v 1.3 2000/10/10 12:51:20 itojun Exp $  */
+/*     $NetBSD: ntpq.c,v 1.4 2001/04/06 11:13:54 wiz Exp $     */
 
 /*
  * ntpq - query an NTP server using mode 6 commands



Home | Main Index | Thread Index | Old Index