File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,6 @@ rc_logger_open(const char *level)
155
155
struct pollfd fd [2 ];
156
156
int s = 0 ;
157
157
size_t bytes ;
158
- int i ;
159
158
FILE * log = NULL ;
160
159
FILE * plog = NULL ;
161
160
const char * logfile ;
@@ -165,12 +164,8 @@ rc_logger_open(const char *level)
165
164
if (!rc_conf_yesno ("rc_logger" ))
166
165
return ;
167
166
168
- if (pipe (signal_pipe ) == -1 )
169
- eerrorx ("pipe: %s" , strerror (errno ));
170
- for (i = 0 ; i < 2 ; i ++ )
171
- if ((s = fcntl (signal_pipe [i ], F_GETFD , 0 ) == -1 ||
172
- fcntl (signal_pipe [i ], F_SETFD , s | FD_CLOEXEC ) == -1 ))
173
- eerrorx ("fcntl: %s" , strerror (errno ));
167
+ if (pipe2 (signal_pipe , O_CLOEXEC ) == -1 )
168
+ eerrorx ("pipe2: %s" , strerror (errno ));
174
169
175
170
if (isatty (STDOUT_FILENO )) {
176
171
tcgetattr (STDOUT_FILENO , & tt );
You can’t perform that action at this time.
0 commit comments