|
4 | 4 | * |
5 | 5 | * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group |
6 | 6 | * |
7 | | - * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.6 2004/06/03 00:07:36 momjian Exp $ |
| 7 | + * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.7 2004/06/04 04:05:36 momjian Exp $ |
8 | 8 | * |
9 | 9 | *------------------------------------------------------------------------- |
10 | 10 | */ |
@@ -730,7 +730,7 @@ do_help(void) |
730 | 730 | printf(_("Options for stop or restart:\n")); |
731 | 731 | printf(_(" -m SHUTDOWN-MODE may be 'smart', 'fast', or 'immediate'\n\n")); |
732 | 732 | printf(_("Allowed signal names for kill:\n")); |
733 | | - printf(_(" -HUP -INT -QUIT -ABRT -TERM -USR1 -USR2\n\n")); |
| 733 | + printf(_(" HUP INT QUIT ABRT TERM USR1 USR2\n\n")); |
734 | 734 | printf(_("Shutdown modes are:\n")); |
735 | 735 | printf(_(" smart quit after all clients have disconnected\n")); |
736 | 736 | printf(_(" fast quit directly, with proper shutdown\n")); |
@@ -771,25 +771,25 @@ set_mode(char *modeopt) |
771 | 771 | static void |
772 | 772 | set_sig(char *signame) |
773 | 773 | { |
774 | | - if (!strcmp(signame, "-HUP")) |
| 774 | + if (!strcmp(signame, "HUP")) |
775 | 775 | sig = SIGHUP; |
776 | | - else if (!strcmp(signame, "-INT")) |
| 776 | + else if (!strcmp(signame, "INT")) |
777 | 777 | sig = SIGINT; |
778 | | - else if (!strcmp(signame, "-QUIT")) |
| 778 | + else if (!strcmp(signame, "QUIT")) |
779 | 779 | sig = SIGQUIT; |
780 | | - else if (!strcmp(signame, "-ABRT")) |
| 780 | + else if (!strcmp(signame, "ABRT")) |
781 | 781 | sig = SIGABRT; |
782 | 782 |
|
783 | 783 | /* |
784 | 784 | * probably should NOT provide SIGKILL |
785 | 785 | * |
786 | | - * else if (!strcmp(signame,"-KILL")) sig = SIGKILL; |
| 786 | + * else if (!strcmp(signame,"KILL")) sig = SIGKILL; |
787 | 787 | */ |
788 | | - else if (!strcmp(signame, "-TERM")) |
| 788 | + else if (!strcmp(signame, "TERM")) |
789 | 789 | sig = SIGTERM; |
790 | | - else if (!strcmp(signame, "-USR1")) |
| 790 | + else if (!strcmp(signame, "USR1")) |
791 | 791 | sig = SIGUSR1; |
792 | | - else if (!strcmp(signame, "-USR2")) |
| 792 | + else if (!strcmp(signame, "USR2")) |
793 | 793 | sig = SIGUSR2; |
794 | 794 | else |
795 | 795 | { |
@@ -936,8 +936,8 @@ main(int argc, char **argv) |
936 | 936 | exit(1); |
937 | 937 | } |
938 | 938 | ctl_command = KILL_COMMAND; |
939 | | - set_sig(argv[optind + 1]); |
940 | | - killproc = atol(argv[optind + 2]); |
| 939 | + set_sig(argv[++optind]); |
| 940 | + killproc = atol(argv[++optind]); |
941 | 941 | } |
942 | 942 | else |
943 | 943 | { |
|
0 commit comments