99 * signals that the backend can recognize.
1010 *
1111 * IDENTIFICATION
12- * $PostgreSQL: pgsql/src/port/kill.c,v 1.13 2010/01/02 16:58:13 momjian Exp $
12+ * $PostgreSQL: pgsql/src/port/kill.c,v 1.14 2010/01/31 17:18:28 mha Exp $
1313 *
1414 *-------------------------------------------------------------------------
1515 */
@@ -25,7 +25,6 @@ pgkill(int pid, int sig)
2525 BYTE sigData = sig ;
2626 BYTE sigRet = 0 ;
2727 DWORD bytes ;
28- int pipe_tries ;
2928
3029 /* we allow signal 0 here, but it will be ignored in pg_queue_signal */
3130 if (sig >= PG_SIGNAL_COUNT || sig < 0 )
@@ -41,23 +40,14 @@ pgkill(int pid, int sig)
4140 }
4241 snprintf (pipename , sizeof (pipename ), "\\\\.\\pipe\\pgsignal_%u" , pid );
4342
44- /*
45- * Writing data to the named pipe can fail for transient reasons.
46- * Therefore, it is useful to retry if it fails. The maximum number of
47- * calls to make was empirically determined from a 90-hour notification
48- * stress test.
49- */
50- for (pipe_tries = 0 ; pipe_tries < 3 ; pipe_tries ++ )
43+ if (CallNamedPipe (pipename , & sigData , 1 , & sigRet , 1 , & bytes , 1000 ))
5144 {
52- if (CallNamedPipe ( pipename , & sigData , 1 , & sigRet , 1 , & bytes , 1000 ) )
45+ if (bytes != 1 || sigRet != sig )
5346 {
54- if (bytes != 1 || sigRet != sig )
55- {
56- errno = ESRCH ;
57- return -1 ;
58- }
59- return 0 ;
47+ errno = ESRCH ;
48+ return -1 ;
6049 }
50+ return 0 ;
6151 }
6252
6353 if (GetLastError () == ERROR_FILE_NOT_FOUND )
0 commit comments