From 5aa3be9ee9a992c99b522ea156bb9744ee4e9611 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Tue, 30 Jan 2018 15:18:36 +0000 Subject: [PATCH] Fix unused variable warnings Move all pipe-specific code under #if HAVE_PIPE --- src/main.c | 12 +++++------- src/task.c | 2 ++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main.c b/src/main.c index 12c2b1b..3ea1887 100644 --- a/src/main.c +++ b/src/main.c @@ -136,6 +136,7 @@ task_perror (RECODE_CONST_TASK task) | Signal handler. | `-----------------*/ +#ifdef HAVE_PIPE static void sig_catch(int sig, void (*handler) (int)) { @@ -153,17 +154,12 @@ signal_handler (int number) sig_catch (number, signal_handler); } -/*------------------------------------------------------------------------. -| Prepare to handle signals, intercept willingful requests for stopping. | -`------------------------------------------------------------------------*/ - static void setup_signals (void) { -#ifdef SIGPIPE - sig_catch (SIGPIPE, signal_handler); -#endif + sig_catch (SIGPIPE, signal_handler); } +#endif /* Main control. */ @@ -777,7 +773,9 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"), exit (EXIT_SUCCESS); } +#if HAVE_PIPE setup_signals (); +#endif { RECODE_TASK task; diff --git a/src/task.c b/src/task.c index fe0493b..d5f30fd 100644 --- a/src/task.c +++ b/src/task.c @@ -228,8 +228,10 @@ perform_sequence (RECODE_TASK task, enum recode_sequence_strategy strategy) struct recode_subtask subtask_block; RECODE_SUBTASK subtask = &subtask_block; +#if HAVE_PIPE int pipe_pair[2]; /* pair of file descriptors for a pipe */ pid_t wait_status; /* status returned by wait() */ +#endif struct recode_read_write_text input; struct recode_read_write_text output; -- 2.50.0