diff options
author | jschauma <jschauma@pkgsrc.org> | 2003-01-07 16:43:56 +0000 |
---|---|---|
committer | jschauma <jschauma@pkgsrc.org> | 2003-01-07 16:43:56 +0000 |
commit | 4b2164510a3dfb0a85ecdc2dd3403397f373a745 (patch) | |
tree | 68fbc023a35ea2e5f6a3157b3cb7eb39e0fc1f1e /pkgtools/pkg_install | |
parent | 37f8100ca0eb8bc3250e1f48e27ee95b72422751 (diff) | |
download | pkgsrc-4b2164510a3dfb0a85ecdc2dd3403397f373a745.tar.gz |
``On second thought, let's not go to Camelot. It is a silly place.''
(Make pkdb_open return pkgdbp!=NULL as src's does, and revert previous
patch. As discussed with agc.)
Diffstat (limited to 'pkgtools/pkg_install')
-rw-r--r-- | pkgtools/pkg_install/files/admin/main.c | 12 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/delete/main.c | 8 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/info/perform.c | 6 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/lib/pkgdb.c | 8 |
4 files changed, 17 insertions, 17 deletions
diff --git a/pkgtools/pkg_install/files/admin/main.c b/pkgtools/pkg_install/files/admin/main.c index a3a6155550e..93869ddf05c 100644 --- a/pkgtools/pkg_install/files/admin/main.c +++ b/pkgtools/pkg_install/files/admin/main.c @@ -1,9 +1,9 @@ -/* $NetBSD: main.c,v 1.3 2003/01/07 16:10:02 jschauma Exp $ */ +/* $NetBSD: main.c,v 1.4 2003/01/07 16:43:56 jschauma Exp $ */ #if 0 #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: main.c,v 1.3 2003/01/07 16:10:02 jschauma Exp $"); +__RCSID("$NetBSD: main.c,v 1.4 2003/01/07 16:43:56 jschauma Exp $"); #endif #endif @@ -192,7 +192,7 @@ rebuild(void) if (unlink(_pkgdb_getPKGDB_FILE(cachename, sizeof(cachename))) != 0 && errno != ENOENT) err(EXIT_FAILURE, "unlink %s", cachename); - if (pkgdb_open(ReadWrite) == -1) + if (!pkgdb_open(ReadWrite)) err(EXIT_FAILURE, "cannot open pkgdb"); setbuf(stdout, NULL); @@ -546,7 +546,7 @@ main(int argc, char *argv[]) printf("Dumping pkgdb %s:\n", _pkgdb_getPKGDB_FILE(cachename, sizeof(cachename))); - if (pkgdb_open(ReadOnly) == -1) { + if (!pkgdb_open(ReadOnly)) { err(EXIT_FAILURE, "cannot open %s", cachename); } while ((key = pkgdb_iter())) { @@ -563,7 +563,7 @@ main(int argc, char *argv[]) int rc; - if (pkgdb_open(ReadWrite) == -1) + if (!pkgdb_open(ReadWrite)) err(EXIT_FAILURE, "cannot open pkgdb"); rc = pkgdb_remove(argv[2]); @@ -580,7 +580,7 @@ main(int argc, char *argv[]) int rc; - if (pkgdb_open(ReadWrite) == -1) { + if (!pkgdb_open(ReadWrite)) { err(EXIT_FAILURE, "cannot open pkgdb"); } diff --git a/pkgtools/pkg_install/files/delete/main.c b/pkgtools/pkg_install/files/delete/main.c index 0a5774cdc6f..2fd3c47f5f7 100644 --- a/pkgtools/pkg_install/files/delete/main.c +++ b/pkgtools/pkg_install/files/delete/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.3 2003/01/07 16:10:03 jschauma Exp $ */ +/* $NetBSD: main.c,v 1.4 2003/01/07 16:43:57 jschauma Exp $ */ #if 0 #include <sys/cdefs.h> @@ -6,7 +6,7 @@ #if 0 static char *rcsid = "from FreeBSD Id: main.c,v 1.11 1997/10/08 07:46:48 charnier Exp"; #else -__RCSID("$NetBSD: main.c,v 1.3 2003/01/07 16:10:03 jschauma Exp $"); +__RCSID("$NetBSD: main.c,v 1.4 2003/01/07 16:43:57 jschauma Exp $"); #endif #endif #endif @@ -133,7 +133,7 @@ main(int argc, char **argv) /* Get all the remaining package names, if any */ if (File2Pkg) - if (pkgdb_open(ReadOnly) == -1) { + if (!pkgdb_open(ReadOnly)) { err(EXIT_FAILURE, "cannot open pkgdb"); } /* Get all the remaining package names, if any */ @@ -182,7 +182,7 @@ main(int argc, char **argv) char *key, *val; char cachename[FILENAME_MAX]; - if (pkgdb_open(ReadWrite) == -1) { + if (!pkgdb_open(ReadWrite)) { err(EXIT_FAILURE, "cannot open %s", _pkgdb_getPKGDB_FILE(cachename, sizeof(cachename))); } diff --git a/pkgtools/pkg_install/files/info/perform.c b/pkgtools/pkg_install/files/info/perform.c index caa0ea77f30..de96bcb8713 100644 --- a/pkgtools/pkg_install/files/info/perform.c +++ b/pkgtools/pkg_install/files/info/perform.c @@ -1,4 +1,4 @@ -/* $NetBSD: perform.c,v 1.3 2003/01/07 16:10:03 jschauma Exp $ */ +/* $NetBSD: perform.c,v 1.4 2003/01/07 16:43:57 jschauma Exp $ */ #if 0 #include <sys/cdefs.h> @@ -6,7 +6,7 @@ #if 0 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.23 1997/10/13 15:03:53 jkh Exp"; #else -__RCSID("$NetBSD: perform.c,v 1.3 2003/01/07 16:10:03 jschauma Exp $"); +__RCSID("$NetBSD: perform.c,v 1.4 2003/01/07 16:43:57 jschauma Exp $"); #endif #endif #endif @@ -338,7 +338,7 @@ pkg_perform(lpkg_head_t *pkghead) char *file, *pkg; /* pkg_info -Fa => Dump pkgdb */ - if (pkgdb_open(ReadOnly) == -1) { + if (!pkgdb_open(ReadOnly)) { err(EXIT_FAILURE, "cannot open pkgdb"); } while ((file = pkgdb_iter())) { diff --git a/pkgtools/pkg_install/files/lib/pkgdb.c b/pkgtools/pkg_install/files/lib/pkgdb.c index 6d3e0237365..48be03fcd10 100644 --- a/pkgtools/pkg_install/files/lib/pkgdb.c +++ b/pkgtools/pkg_install/files/lib/pkgdb.c @@ -1,9 +1,9 @@ -/* $NetBSD: pkgdb.c,v 1.3 2003/01/07 06:42:28 grant Exp $ */ +/* $NetBSD: pkgdb.c,v 1.4 2003/01/07 16:43:57 jschauma Exp $ */ #if 0 #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: pkgdb.c,v 1.3 2003/01/07 06:42:28 grant Exp $"); +__RCSID("$NetBSD: pkgdb.c,v 1.4 2003/01/07 16:43:57 jschauma Exp $"); #endif #endif @@ -95,9 +95,9 @@ pkgdb_open(int mode) pkgdbp = (DB *) dbopen(_pkgdb_getPKGDB_FILE(cachename, sizeof(cachename)), (mode == ReadOnly) ? O_RDONLY : O_RDWR | O_CREAT, 0644, DB_BTREE, (void *) &info); - return (pkgdbp == NULL) ? -1 : 0; + return (pkgdbp != NULL); #else - return 1; + return -1; #endif /* HAVE_DBOPEN */ } |