From ben@scientia.demon.co.uk Thu Apr  1 09:06:39 1999
Return-Path: <ben@scientia.demon.co.uk>
Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13])
	by hub.freebsd.org (Postfix) with ESMTP id 6D70814E3E
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  1 Apr 1999 09:05:43 -0800 (PST)
	(envelope-from ben@scientia.demon.co.uk)
Received: from scientia.demon.co.uk (ident=ben)
	by scientia.demon.co.uk with local (Exim 2.12 #4)
	id 10Sklf-000Mtd-00 for FreeBSD-gnats-submit@freebsd.org;
	Thu, 1 Apr 1999 17:56:35 +0100
	(envelope-from ben@scientia.demon.co.uk)
Message-Id: <E10Sklf-000Mtd-00@scientia.demon.co.uk>
Date: Thu, 1 Apr 1999 17:56:35 +0100
From: Ben Smithurst <ben@scientia.demon.co.uk>
Reply-To: ben@scientia.demon.co.uk
To: FreeBSD-gnats-submit@freebsd.org
Subject: sa(8) exits non-zero even on success
X-Send-Pr-Version: 3.2

>Number:         10904
>Category:       bin
>Synopsis:       sa(8) exits non-zero even on success
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr  1 09:10:00 PST 1999
>Closed-Date:    Sat May 22 15:56:51 PDT 1999
>Last-Modified:  Sat May 22 15:57:48 PDT 1999
>Originator:     Ben Smithurst
>Release:        FreeBSD 3.1-STABLE i386
>Organization:
>Environment:

FreeBSD scientia.demon.co.uk 3.1-STABLE FreeBSD 3.1-STABLE #112: Tue Mar 30 01:39:04 BST 1999     ben@scientia.demon.co.uk:/usr/src/sys/compile/SCIENTIA  i386

>Description:

When sa(8) is run, the exit status isn't zero, even if no errors occur.

>How-To-Repeat:

$ sa -m
$ echo $?

On my system, the exit status is consistenly 104.

>Fix:

the error variable needs to be initialized to zero, I beleive.

--- main.c.orig	Thu Apr  1 17:50:24 1999
+++ main.c	Thu Apr  1 17:50:29 1999
@@ -84,7 +84,7 @@
 	char **argv;
 {
 	char ch;
-	int error;
+	int error = 0;
 
 	while ((ch = getopt(argc, argv, "abcdDfijkKlmnqrstuv:")) != -1)
 		switch (ch) {

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jmz 
State-Changed-When: Sat May 22 15:56:51 PDT 1999 
State-Changed-Why:  
Patch applied. Thanks! 
>Unformatted:
