From 5d1daa98e441fffd05a05461b16cba34b90d04ee Mon Sep 17 00:00:00 2001 From: Avril Date: Fri, 11 Mar 2022 17:23:47 +0000 Subject: [PATCH] Removed redundant unused old code block comment. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fortune for sink's current commit: Future curse − 末凶 --- sink.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/sink.c b/sink.c index e48bab9..962ee7b 100644 --- a/sink.c +++ b/sink.c @@ -70,18 +70,11 @@ static int save_stderr() perror("failed to pdup(stderr)"); return 0; } -#if 0 - int sfd = fileno(stderr); - if(UNLIKELY( dup2(b_stderr, sfd) < 0 )) { - perror("failed to dup2() to stderr"); - return 0; - } //else if(UNLIKELY( pfd(sfd) < 0 )) return (perror("failed to (redundantly?) FD_CLOEXEC b_stderrr"),0); // TODO: XXX: Does dup2() copy the CLOEXEC flag? Find out, and it it does, remove this line. -#else + if(UNLIKELY( !fdreopen(&stderr, b_stderr, "wb") )) { perror("failed to reopen parent stderr with pdup()'d stream"); return 0; } -#endif return 1; }