smallint quotef;
smallint dblquote;
smallint oldstyle;
- smallint prevsyntax; /* syntax before arithmetic */
+ IF_SH_MATH_SUPPORT(smallint prevsyntax;) /* syntax before arithmetic */
#if ENABLE_ASH_EXPAND_PRMT
smallint pssyntax; /* we are expanding a prompt string */
#endif
int varnest; /* levels of variables expansion */
- int arinest; /* levels of arithmetic expansion */
- int parenlevel; /* levels of parens in arithmetic */
+ IF_SH_MATH_SUPPORT(int arinest;) /* levels of arithmetic expansion */
+ IF_SH_MATH_SUPPORT(int parenlevel;) /* levels of parens in arithmetic */
int dqvarnest; /* levels of variables expansion within double quotes */
IF_ASH_BASH_COMPAT(smallint bash_dollar_squote = 0;)
startlinno = g_parsefile->linno;
bqlist = NULL;
quotef = 0;
- prevsyntax = 0;
+ IF_SH_MATH_SUPPORT(prevsyntax = 0;)
#if ENABLE_ASH_EXPAND_PRMT
pssyntax = (syntax == PSSYNTAX);
if (pssyntax)
#endif
dblquote = (syntax == DQSYNTAX);
varnest = 0;
- arinest = 0;
- parenlevel = 0;
+ IF_SH_MATH_SUPPORT(arinest = 0;)
+ IF_SH_MATH_SUPPORT(parenlevel = 0;)
dqvarnest = 0;
STARTSTACKSTR(out);
}
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 */
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).
* 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 */