Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 52e98d4

Browse filesBrowse files
committed
Use signal-safe functions in signal handler
According to signal-safety(7), exit(3) and puts(3) are not safe to call in a signal handler. Author: Tristan Partin <tristan@neon.tech> Discussion: https://www.postgresql.org/message-id/flat/CTVDKVZCCVSY.1XQ87UL50KQRD%40gonk
1 parent 7636725 commit 52e98d4
Copy full SHA for 52e98d4

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎src/bin/pg_test_fsync/pg_test_fsync.c

Copy file name to clipboardExpand all lines: src/bin/pg_test_fsync/pg_test_fsync.c
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,8 @@ signal_cleanup(SIGNAL_ARGS)
602602
if (needs_unlink)
603603
unlink(filename);
604604
/* Finish incomplete line on stdout */
605-
puts("");
606-
exit(1);
605+
write(STDOUT_FILENO, "\n", 1);
606+
_exit(1);
607607
}
608608

609609
#ifdef HAVE_FSYNC_WRITETHROUGH

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.