shell: suppress "unused var/func" warnings on some configs
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
4f13a70507
commit
b6afcc7819
12
shell/ash.c
12
shell/ash.c
@ -11373,13 +11373,13 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs)
|
|||||||
smallint quotef;
|
smallint quotef;
|
||||||
smallint dblquote;
|
smallint dblquote;
|
||||||
smallint oldstyle;
|
smallint oldstyle;
|
||||||
smallint prevsyntax; /* syntax before arithmetic */
|
IF_SH_MATH_SUPPORT(smallint prevsyntax;) /* syntax before arithmetic */
|
||||||
#if ENABLE_ASH_EXPAND_PRMT
|
#if ENABLE_ASH_EXPAND_PRMT
|
||||||
smallint pssyntax; /* we are expanding a prompt string */
|
smallint pssyntax; /* we are expanding a prompt string */
|
||||||
#endif
|
#endif
|
||||||
int varnest; /* levels of variables expansion */
|
int varnest; /* levels of variables expansion */
|
||||||
int arinest; /* levels of arithmetic expansion */
|
IF_SH_MATH_SUPPORT(int arinest;) /* levels of arithmetic expansion */
|
||||||
int parenlevel; /* levels of parens in arithmetic */
|
IF_SH_MATH_SUPPORT(int parenlevel;) /* levels of parens in arithmetic */
|
||||||
int dqvarnest; /* levels of variables expansion within double quotes */
|
int dqvarnest; /* levels of variables expansion within double quotes */
|
||||||
|
|
||||||
IF_ASH_BASH_COMPAT(smallint bash_dollar_squote = 0;)
|
IF_ASH_BASH_COMPAT(smallint bash_dollar_squote = 0;)
|
||||||
@ -11387,7 +11387,7 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs)
|
|||||||
startlinno = g_parsefile->linno;
|
startlinno = g_parsefile->linno;
|
||||||
bqlist = NULL;
|
bqlist = NULL;
|
||||||
quotef = 0;
|
quotef = 0;
|
||||||
prevsyntax = 0;
|
IF_SH_MATH_SUPPORT(prevsyntax = 0;)
|
||||||
#if ENABLE_ASH_EXPAND_PRMT
|
#if ENABLE_ASH_EXPAND_PRMT
|
||||||
pssyntax = (syntax == PSSYNTAX);
|
pssyntax = (syntax == PSSYNTAX);
|
||||||
if (pssyntax)
|
if (pssyntax)
|
||||||
@ -11395,8 +11395,8 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs)
|
|||||||
#endif
|
#endif
|
||||||
dblquote = (syntax == DQSYNTAX);
|
dblquote = (syntax == DQSYNTAX);
|
||||||
varnest = 0;
|
varnest = 0;
|
||||||
arinest = 0;
|
IF_SH_MATH_SUPPORT(arinest = 0;)
|
||||||
parenlevel = 0;
|
IF_SH_MATH_SUPPORT(parenlevel = 0;)
|
||||||
dqvarnest = 0;
|
dqvarnest = 0;
|
||||||
|
|
||||||
STARTSTACKSTR(out);
|
STARTSTACKSTR(out);
|
||||||
|
@ -1574,9 +1574,8 @@ static sighandler_t install_sighandler(int sig, sighandler_t handler)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void hush_exit(int exitcode) NORETURN;
|
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)
|
static void restore_ttypgrp_and__exit(void)
|
||||||
{
|
{
|
||||||
/* xfunc has failed! die die die */
|
/* xfunc has failed! die die die */
|
||||||
@ -1585,6 +1584,8 @@ static void restore_ttypgrp_and__exit(void)
|
|||||||
hush_exit(xfunc_error_retval);
|
hush_exit(xfunc_error_retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENABLE_HUSH_JOB
|
||||||
|
|
||||||
/* Needed only on some libc:
|
/* Needed only on some libc:
|
||||||
* It was observed that on exit(), fgetc'ed buffered data
|
* It was observed that on exit(), fgetc'ed buffered data
|
||||||
* gets "unwound" via lseek(fd, -NUM, SEEK_CUR).
|
* gets "unwound" via lseek(fd, -NUM, SEEK_CUR).
|
||||||
@ -1598,14 +1599,13 @@ static void restore_ttypgrp_and__exit(void)
|
|||||||
* and in `cmd` handling.
|
* and in `cmd` handling.
|
||||||
* If set as die_func(), this makes xfunc_die() exit via _exit(), not exit():
|
* 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)
|
static void fflush_and__exit(void)
|
||||||
{
|
{
|
||||||
fflush_all();
|
fflush_all();
|
||||||
_exit(xfunc_error_retval);
|
_exit(xfunc_error_retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_HUSH_JOB
|
|
||||||
|
|
||||||
/* After [v]fork, in child: do not restore tty pgrp on xfunc death */
|
/* 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)
|
# define disable_restore_tty_pgrp_on_exit() (die_func = fflush_and__exit)
|
||||||
/* After [v]fork, in parent: restore tty pgrp on xfunc death */
|
/* After [v]fork, in parent: restore tty pgrp on xfunc death */
|
||||||
|
Loading…
Reference in New Issue
Block a user