OSDN Git Service

Fix exit status
authorTakashi Iwai <tiwai@suse.de>
Mon, 31 Jan 2005 13:52:09 +0000 (13:52 +0000)
committerTakashi Iwai <tiwai@suse.de>
Mon, 31 Jan 2005 13:52:09 +0000 (13:52 +0000)
Return the exit status 0 after -h option.
When invalid options are given, it should return exit code 1.

amixer/amixer.c

index 57912a3..97fe5d5 100644 (file)
@@ -1469,8 +1469,8 @@ int main(int argc, char *argv[])
                switch (c) {
                case 'h':
                case HELPID_HELP:
-                       morehelp++;
-                       break;
+                       help();
+                       return 0;
                case 'c':
                case HELPID_CARD:
                        {
@@ -1512,7 +1512,7 @@ int main(int argc, char *argv[])
        }
        if (morehelp) {
                help();
-               return 0;
+               return 1;
        }
        if (argc - optind <= 0) {
                return selems(LEVEL_BASIC | level) ? 1 : 0;