Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitaef61bf

Browse files
committed
Revert dup2() checking in syslogger.c
Per the expanded comment-As we're just trying to reset these to go to DEVNULL, there's notmuch point in checking for failure from the close/dup2 calls here,if they fail then presumably the file descriptors are closed andany writes will go into the bitbucket anyway.Pointed out by Tom.
1 parent64e43c5 commitaef61bf

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

‎src/backend/postmaster/syslogger.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,19 +205,18 @@ SysLoggerMain(int argc, char *argv[])
205205
* darn sure the pipe gets closed even if the open failed.We can
206206
* survive running with stderr pointing nowhere, but we can't afford
207207
* to have extra pipe input descriptors hanging around.
208+
*
209+
* As we're just trying to reset these to go to DEVNULL, there's not
210+
* much point in checking for failure from the close/dup2 calls here,
211+
* if they fail then presumably the file descriptors are closed and
212+
* any writes will go into the bitbucket anyway.
208213
*/
209214
close(fileno(stdout));
210215
close(fileno(stderr));
211216
if (fd!=-1)
212217
{
213-
if (dup2(fd,fileno(stdout))<0)
214-
ereport(FATAL,
215-
(errcode_for_file_access(),
216-
errmsg("could not redirect stdout: %m")));
217-
if (dup2(fd,fileno(stderr))<0)
218-
ereport(FATAL,
219-
(errcode_for_file_access(),
220-
errmsg("could not redirect stderr: %m")));
218+
(void)dup2(fd,fileno(stdout));
219+
(void)dup2(fd,fileno(stderr));
221220
close(fd);
222221
}
223222
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp