Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bf2a115

Browse files
committed
Remove dash in pg_ctl signal name. It broke with getopt_long dash
reorganization processing, and it is clearer without the dash anyway.
1 parent 223b813 commit bf2a115

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

doc/src/sgml/ref/pg_ctl-ref.sgml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/pg_ctl-ref.sgml,v 1.27 2004/05/27 03:50:25 momjian Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/pg_ctl-ref.sgml,v 1.28 2004/06/04 04:05:36 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -140,7 +140,8 @@ PostgreSQL documentation
140140
<para>
141141
<option>kill</option> mode allows you to send a signal to a specified
142142
process. This is particularly valuable for <productname>MS Windows</>
143-
which does not have a <application>kill</> command.
143+
which does not have a <application>kill</> command. Use
144+
<literal>--help</> to see a list of supported signal names.
144145
</para>
145146
</refsect1>
146147

src/bin/pg_ctl/pg_ctl.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
66
*
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 $
88
*
99
*-------------------------------------------------------------------------
1010
*/
@@ -730,7 +730,7 @@ do_help(void)
730730
printf(_("Options for stop or restart:\n"));
731731
printf(_(" -m SHUTDOWN-MODE may be 'smart', 'fast', or 'immediate'\n\n"));
732732
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"));
734734
printf(_("Shutdown modes are:\n"));
735735
printf(_(" smart quit after all clients have disconnected\n"));
736736
printf(_(" fast quit directly, with proper shutdown\n"));
@@ -771,25 +771,25 @@ set_mode(char *modeopt)
771771
static void
772772
set_sig(char *signame)
773773
{
774-
if (!strcmp(signame, "-HUP"))
774+
if (!strcmp(signame, "HUP"))
775775
sig = SIGHUP;
776-
else if (!strcmp(signame, "-INT"))
776+
else if (!strcmp(signame, "INT"))
777777
sig = SIGINT;
778-
else if (!strcmp(signame, "-QUIT"))
778+
else if (!strcmp(signame, "QUIT"))
779779
sig = SIGQUIT;
780-
else if (!strcmp(signame, "-ABRT"))
780+
else if (!strcmp(signame, "ABRT"))
781781
sig = SIGABRT;
782782

783783
/*
784784
* probably should NOT provide SIGKILL
785785
*
786-
* else if (!strcmp(signame,"-KILL")) sig = SIGKILL;
786+
* else if (!strcmp(signame,"KILL")) sig = SIGKILL;
787787
*/
788-
else if (!strcmp(signame, "-TERM"))
788+
else if (!strcmp(signame, "TERM"))
789789
sig = SIGTERM;
790-
else if (!strcmp(signame, "-USR1"))
790+
else if (!strcmp(signame, "USR1"))
791791
sig = SIGUSR1;
792-
else if (!strcmp(signame, "-USR2"))
792+
else if (!strcmp(signame, "USR2"))
793793
sig = SIGUSR2;
794794
else
795795
{
@@ -936,8 +936,8 @@ main(int argc, char **argv)
936936
exit(1);
937937
}
938938
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]);
941941
}
942942
else
943943
{

0 commit comments

Comments
 (0)