NetBSD Problem Report #24863

Received: (qmail 29740 invoked by uid 605); 20 Mar 2004 18:25:32 -0000
Message-Id: <200403201825.i2KIPTu4011206@mercury.pointless.nl>
Date: Sat, 20 Mar 2004 19:25:29 +0100 (CET)
From: Peter Postma <peter@pointless.nl>
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: peter@pointless.nl
To: gnats-bugs@gnats.NetBSD.org
Subject: check for correct return value in main.c pkg_info(1)
X-Send-Pr-Version: 3.95

>Number:         24863
>Category:       bin
>Synopsis:       check for correct return value in main.c pkg_info(1)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 20 18:26:00 +0000 2004
>Closed-Date:    Wed Mar 24 22:18:51 +0000 2004
>Last-Modified:  Wed Mar 24 22:18:51 +0000 2004
>Originator:     Peter Postma
>Release:        NetBSD 1.6ZK
>Organization:
>Environment:
System: NetBSD mercury.pointless.nl 1.6ZK NetBSD 1.6ZK (mercury) #27: Sat Mar 13 14:35:22 CET 2004 peter@mercury.pointless.nl:/usr/obj/sys/arch/sparc64/compile/mercury sparc64
Architecture: sparc64
Machine: sparc64
>Description:
	In usr.sbin/pkg_install/info/main.c: 

	pkgdb_open returns 0 or 1, so don't check if it's -1.
>How-To-Repeat:
>Fix:

Index: main.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/pkg_install/info/main.c,v
retrieving revision 1.38
diff -u -r1.38 main.c
--- main.c	6 Jan 2004 15:48:47 -0000	1.38
+++ main.c	20 Mar 2004 18:21:22 -0000
@@ -230,7 +230,7 @@

 	/* Get all the remaining package names, if any */
 	if (File2Pkg && !AllInstalled)
-		if (pkgdb_open(ReadOnly) == -1) {
+		if (!pkgdb_open(ReadOnly)) {
 			err(EXIT_FAILURE, "cannot open pkgdb");
 		}
 	while (*argv) {
>Release-Note:
>Audit-Trail:

From: Thomas Klausner <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/24863 CVS commit: src/usr.sbin/pkg_install/info
Date: Mon, 22 Mar 2004 11:42:52 +0000 (UTC)

 Module Name:	src
 Committed By:	wiz
 Date:		Mon Mar 22 11:42:51 UTC 2004

 Modified Files:
 	src/usr.sbin/pkg_install/info: main.c

 Log Message:
 Check pkgdb_open for correct return value.
 From Peter Postma in PR 24863.


 To generate a diff of this commit:
 cvs rdiff -r1.38 -r1.39 src/usr.sbin/pkg_install/info/main.c

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


From: Thomas Klausner <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/24863 CVS commit: pkgsrc/pkgtools/pkg_install/files/info
Date: Mon, 22 Mar 2004 11:44:24 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	wiz
 Date:		Mon Mar 22 11:44:24 UTC 2004

 Modified Files:
 	pkgsrc/pkgtools/pkg_install/files/info: main.c

 Log Message:
 1.39 from usr.sbin/pkg_install/info/main.c:
 Check pkgdb_open for correct return value.
 From Peter Postma in PR 24863.


 To generate a diff of this commit:
 cvs rdiff -r1.7 -r1.8 pkgsrc/pkgtools/pkg_install/files/info/main.c

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

State-Changed-From-To: open->feedback 
State-Changed-By: garbled 
State-Changed-When: Wed Mar 24 22:14:27 UTC 2004 
State-Changed-Why:  
This appears to have been committed.  Does this fix the problem for you? 

From: Peter Postma <peter@pointless.nl>
To: gnats-bugs@gnats.netbsd.org
Cc: garbled@netbsd.org
Subject: Re: bin/24863
Date: Wed, 24 Mar 2004 23:17:22 +0100

 On Wed, Mar 24, 2004 at 10:14:45PM -0000, garbled@netbsd.org wrote:
 > Synopsis: check for correct return value in main.c pkg_info(1)
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: garbled
 > State-Changed-When: Wed Mar 24 22:14:27 UTC 2004
 > State-Changed-Why: 
 > This appears to have been committed.  Does this fix the problem for you?
 > 

 Yes, thanks.

 -- 
 Peter Postma
State-Changed-From-To: feedback->closed 
State-Changed-By: garbled 
State-Changed-When: Wed Mar 24 22:18:39 UTC 2004 
State-Changed-Why:  
Submitter confirmed fix. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.