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

Commit 623cf5e

Browse files
committed
Add a failure check for syslogger's use of _beginthreadex(), and remove
unnecessary thread address output parameter, to make this code look more like that in pg_restore.
1 parent c242502 commit 623cf5e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/backend/postmaster/syslogger.c

+4-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
*
2020
* IDENTIFICATION
21-
* $PostgreSQL: pgsql/src/backend/postmaster/syslogger.c,v 1.47 2009/01/01 17:23:46 momjian Exp $
21+
* $PostgreSQL: pgsql/src/backend/postmaster/syslogger.c,v 1.48 2009/02/03 00:59:26 tgl Exp $
2222
*
2323
*-------------------------------------------------------------------------
2424
*/
@@ -267,11 +267,9 @@ SysLoggerMain(int argc, char *argv[])
267267
/* Fire up separate data transfer thread */
268268
InitializeCriticalSection(&sysfileSection);
269269

270-
{
271-
unsigned int tid;
272-
273-
threadHandle = (HANDLE) _beginthreadex(0, 0, pipeThread, 0, 0, &tid);
274-
}
270+
threadHandle = (HANDLE) _beginthreadex(NULL, 0, pipeThread, NULL, 0, NULL);
271+
if (threadHandle == 0)
272+
elog(FATAL, "could not create syslogger data transfer thread: %m");
275273
#endif /* WIN32 */
276274

277275
/* remember active logfile parameters */

0 commit comments

Comments
 (0)