Fix compilation warnings/errors when MKSH_NOPROSPECTOFWORK is defined

-----
jobs.c: In function `j_waitj':
jobs.c:1117: warning: unused variable `omask'
jobs.c: In function `j_sigchld':
jobs.c:1321: error: `sm_sigchld' undeclared (first use in this function)
jobs.c:1321: error: (Each undeclared identifier is reported only once
jobs.c:1321: error: for each function it appears in.)
-----
This commit is contained in:
KO Myung-Hun 2015-05-17 16:37:09 +09:00
parent 3af76d7f94
commit d601372feb

6
jobs.c
View File

@ -1113,8 +1113,10 @@ j_waitj(Job *j,
{
Proc *p;
int rv;
#ifndef MKSH_NOPROSPECTOFWORK
#ifdef MKSH_NO_SIGSUSPEND
sigset_t omask;
#endif
#endif
/*
@ -1314,6 +1316,7 @@ j_sigchld(int sig MKSH_A_UNUSED)
pid_t pid;
int status;
struct rusage ru0, ru1;
#ifndef MKSH_NOPROSPECTOFWORK
#ifdef MKSH_NO_SIGSUSPEND
sigset_t omask;
@ -1321,7 +1324,6 @@ j_sigchld(int sig MKSH_A_UNUSED)
sigprocmask(SIG_BLOCK, &sm_sigchld, &omask);
#endif
#ifndef MKSH_NOPROSPECTOFWORK
/*
* Don't wait for any processes if a job is partially started.
* This is so we don't do away with the process group leader
@ -1404,8 +1406,10 @@ j_sigchld(int sig MKSH_A_UNUSED)
#endif
j_sigchld_out:
#ifndef MKSH_NOPROSPECTOFWORK
#ifdef MKSH_NO_SIGSUSPEND
sigprocmask(SIG_SETMASK, &omask, NULL);
#endif
#endif
errno = saved_errno;
}