diff --git a/src/backend/port/win32/timer.c b/src/backend/port/win32/timer.c index 3405253af30..6c90f49d837 100644 --- a/src/backend/port/win32/timer.c +++ b/src/backend/port/win32/timer.c @@ -103,7 +103,7 @@ setitimer(int which, const struct itimerval *value, struct itimerval *ovalue) InitializeCriticalSection(&timerCommArea.crit_sec); timerThreadHandle = CreateThread(NULL, 0, pg_timer_thread, NULL, 0, NULL); - if (timerThreadHandle == INVALID_HANDLE_VALUE) + if (timerThreadHandle == NULL) ereport(FATAL, (errmsg_internal("could not create timer thread: error code %lu", GetLastError()))); diff --git a/src/bin/pg_test_fsync/pg_test_fsync.c b/src/bin/pg_test_fsync/pg_test_fsync.c index f7bc199a30a..860d6b181ea 100644 --- a/src/bin/pg_test_fsync/pg_test_fsync.c +++ b/src/bin/pg_test_fsync/pg_test_fsync.c @@ -45,8 +45,7 @@ do { \ #define START_TIMER \ do { \ alarm_triggered = false; \ - if (CreateThread(NULL, 0, process_alarm, NULL, 0, NULL) == \ - INVALID_HANDLE_VALUE) \ + if (CreateThread(NULL, 0, process_alarm, NULL, 0, NULL) == NULL) \ pg_fatal("could not create thread for alarm"); \ gettimeofday(&start_t, NULL); \ } while (0)