mirror of
https://github.com/irssi/irssi.git
synced 2026-08-23 18:42:53 +02:00
Use -1 to indicate the pipe is not opened
0 can be a valid FD, this removes any ambiguity.
This commit is contained in:
parent
70c160d26d
commit
e445f66bdc
1 changed files with 2 additions and 2 deletions
|
|
@ -738,7 +738,7 @@ static void init_configfile(void)
|
||||||
|
|
||||||
if (pipe(signal_wakeup_pipe)) {
|
if (pipe(signal_wakeup_pipe)) {
|
||||||
g_warning("Failed to create signal wakeup pipe - SIGTERM not attached");
|
g_warning("Failed to create signal wakeup pipe - SIGTERM not attached");
|
||||||
signal_wakeup_pipe[0] = 0;
|
signal_wakeup_pipe[0] = -1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (set_nonblock_flag(signal_wakeup_pipe[0]) || set_nonblock_flag(signal_wakeup_pipe[1])) {
|
if (set_nonblock_flag(signal_wakeup_pipe[0]) || set_nonblock_flag(signal_wakeup_pipe[1])) {
|
||||||
|
|
@ -772,7 +772,7 @@ static void deinit_configfile(void)
|
||||||
g_io_channel_unref(signal_wakeup_read_channel);
|
g_io_channel_unref(signal_wakeup_read_channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (signal_wakeup_pipe[0]) {
|
if (signal_wakeup_pipe[0] != -1) {
|
||||||
close(signal_wakeup_pipe[0]);
|
close(signal_wakeup_pipe[0]);
|
||||||
close(signal_wakeup_pipe[1]);
|
close(signal_wakeup_pipe[1]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue