From b6afcc78194aa0801544bc606b9562339c846eb4 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 12 Dec 2016 16:30:20 +0100 Subject: shell: suppress "unused var/func" warnings on some configs Signed-off-by: Denys Vlasenko --- shell/hush.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'shell/hush.c') diff --git a/shell/hush.c b/shell/hush.c index bcd4dffee..888be6e6e 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -1574,9 +1574,8 @@ static sighandler_t install_sighandler(int sig, sighandler_t handler) } static void hush_exit(int exitcode) NORETURN; -static void fflush_and__exit(void) NORETURN; -static void restore_ttypgrp_and__exit(void) NORETURN; +static void restore_ttypgrp_and__exit(void) NORETURN; static void restore_ttypgrp_and__exit(void) { /* xfunc has failed! die die die */ @@ -1585,6 +1584,8 @@ static void restore_ttypgrp_and__exit(void) hush_exit(xfunc_error_retval); } +#if ENABLE_HUSH_JOB + /* Needed only on some libc: * It was observed that on exit(), fgetc'ed buffered data * gets "unwound" via lseek(fd, -NUM, SEEK_CUR). @@ -1598,14 +1599,13 @@ static void restore_ttypgrp_and__exit(void) * and in `cmd` handling. * If set as die_func(), this makes xfunc_die() exit via _exit(), not exit(): */ +static void fflush_and__exit(void) NORETURN; static void fflush_and__exit(void) { fflush_all(); _exit(xfunc_error_retval); } -#if ENABLE_HUSH_JOB - /* After [v]fork, in child: do not restore tty pgrp on xfunc death */ # define disable_restore_tty_pgrp_on_exit() (die_func = fflush_and__exit) /* After [v]fork, in parent: restore tty pgrp on xfunc death */ -- cgit v1.2.3