summaryrefslogtreecommitdiff
path: root/pkgtools/pkg_install/files/add/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'pkgtools/pkg_install/files/add/main.c')
-rw-r--r--pkgtools/pkg_install/files/add/main.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/pkgtools/pkg_install/files/add/main.c b/pkgtools/pkg_install/files/add/main.c
index 2359fb0fb99..e8893095019 100644
--- a/pkgtools/pkg_install/files/add/main.c
+++ b/pkgtools/pkg_install/files/add/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.6 2003/12/20 04:23:05 grant Exp $ */
+/* $NetBSD: main.c,v 1.7 2004/12/09 20:10:34 erh Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -11,7 +11,7 @@
#if 0
static char *rcsid = "from FreeBSD Id: main.c,v 1.16 1997/10/08 07:45:43 charnier Exp";
#else
-__RCSID("$NetBSD: main.c,v 1.6 2003/12/20 04:23:05 grant Exp $");
+__RCSID("$NetBSD: main.c,v 1.7 2004/12/09 20:10:34 erh Exp $");
#endif
#endif
@@ -65,7 +65,7 @@ char *PkgName = NULL;
char *Directory = NULL;
char FirstPen[FILENAME_MAX];
add_mode_t AddMode = NORMAL;
-Boolean Replace = FALSE;
+int Replace = 0;
static void
usage(void)
@@ -134,7 +134,7 @@ main(int argc, char **argv)
break;
case 'u':
- Replace = 1;
+ Replace++;
break;
case 'V':
@@ -178,12 +178,14 @@ main(int argc, char **argv)
TAILQ_INSERT_TAIL(&pkgs, lpp, lp_link);
}
- } else if (!ch)
- /* If no packages, yelp */
- warnx("missing package name(s)"), usage();
- else if (ch > 1 && AddMode == MASTER)
- warnx("only one package name may be specified with master mode"),
- usage();
+
+ if (!ch)
+ /* If no packages, yelp */
+ warnx("missing package name(s)"), usage();
+ else if (ch > 1 && AddMode == MASTER)
+ warnx("only one package name may be specified with master mode"),
+ usage();
+ }
/* Increase # of max. open file descriptors as high as possible */
rc = getrlimit(RLIMIT_NOFILE, &rlim);