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

Commit 5e1e47c

Browse files
committed
Ignore SIGSYS during initdb.
This prevents the recently-added probe for shm_open() from crashing on platforms that are impolite enough to deliver a signal rather than returning ENOSYS for an unimplemented kernel call. At least on the one known example (HPUX 10.20), ignoring SIGSYS does result in the desired behavior of getting an ENOSYS error return instead. Per discussion, we might later wish to do this in the backend as well, but for now it seems sufficient to do it in initdb.
1 parent 3147acd commit 5e1e47c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/bin/initdb/initdb.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3197,6 +3197,11 @@ setup_signals(void)
31973197
#ifdef SIGPIPE
31983198
pqsignal(SIGPIPE, SIG_IGN);
31993199
#endif
3200+
3201+
/* Prevent SIGSYS so we can probe for kernel calls that might not work */
3202+
#ifdef SIGSYS
3203+
pqsignal(SIGSYS, SIG_IGN);
3204+
#endif
32003205
}
32013206

32023207

0 commit comments

Comments
 (0)