6515521 praudit should return non-zero when the trail file is not accessible
authorjf206706
Fri, 25 Apr 2008 03:37:48 -0700
changeset 6486 fcd258623d1a
parent 6485 1c2754438c47
child 6487 913ca895cab5
6515521 praudit should return non-zero when the trail file is not accessible
usr/src/cmd/praudit/main.c
--- a/usr/src/cmd/praudit/main.c	Thu Apr 24 19:32:33 2008 -0700
+++ b/usr/src/cmd/praudit/main.c	Fri Apr 25 03:37:48 2008 -0700
@@ -2,9 +2,8 @@
  * CDDL HEADER START
  *
  * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
  *
  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  * or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 1993-2002 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -86,7 +85,7 @@
 					(void) fprintf(stderr,
 					    gettext("praudit: Can't assign %s "
 					    "to stdin.\n"), names[i]);
-					break;
+					exit(1);
 				}
 			}
 
@@ -104,11 +103,11 @@
 	if (retstat == -2) {
 		(void) printf(gettext("\nusage: praudit [-r/-s] [-l] [-x] "
 		    "[-ddel] [-c] filename...\n"));
-		retstat = -1;
+		exit(1);
+	} else if (retstat < 0) {
+		exit(1);
 	}
-	if (retstat == 1)
-		retstat = 0;
-	return (retstat);
+	return (0);
 }