]> granicus.if.org Git - sysstat/commitdiff
Set exit code to 0 for sa2 script shell.
authorSebastien Godard <sysstat@orange.fr>
Thu, 15 Mar 2012 15:49:36 +0000 (16:49 +0100)
committerSebastien Godard <sysstat@orange.fr>
Thu, 15 Mar 2012 15:49:36 +0000 (16:49 +0100)
Mail from Peter Schiffer (pschiffe@redhat.com) 13/03/2012

Hello,

we have found minor issue in sysstat. Exit code of sa2 doesn't have to be 0 even if everything is OK. This is because the last operation there is precautionary rmdir which may not have anything to do:

$ sudo sh /usr/lib64/sa/sa2 -A
$ echo $?
1

I'm attaching simple patch adding "exit 0" at the end of sa1 and sa2. What do you think?

Thanks,

CHANGES
sa2.in

diff --git a/CHANGES b/CHANGES
index 6035bccff4cb3e1408f70c9a6f1273d55c967ee0..d5b8240eb953c013db79d9a1a67553ca614d77d7 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,7 @@
 Changes:
 
 xxxx/xx/xx: Version 10.0.5 - Sebastien Godard (sysstat <at> orange.fr)
+       * [Peter Schiffer]: Set exit code to 0 for sa2 shell script.
 
 2012/03/07: Version 10.0.4 - Sebastien Godard (sysstat <at> orange.fr)
        * [Andrey Borzenkov]: Don't take virtual devices into account in
diff --git a/sa2.in b/sa2.in
index 325edb435fe66519749aa7048342f9126eb67e60..9f5fa5ab8f4f2cf1db33d8fdbf74cc4e50b642e3 100644 (file)
--- a/sa2.in
+++ b/sa2.in
@@ -1,6 +1,6 @@
 #!/bin/sh
 # @SA_LIB_DIR@/sa2
-# (C) 1999-2011 Sebastien Godard (sysstat <at> orange.fr)
+# (C) 1999-2012 Sebastien Godard (sysstat <at> orange.fr)
 #
 #@(#) @PACKAGE_NAME@-@PACKAGE_VERSION@
 #@(#) sa2: Write a daily report
@@ -60,4 +60,5 @@ for f in `find ${DDIR} \( -name 'sar??' -o -name 'sa??' \) -type l`; do
 done
 cd ${DDIR}
 rmdir [0-9]????? > /dev/null 2>&1
+exit 0