Fix compiling problem by adding prefix name svr4 to si_xxx macro, the
si_xxx macro should not be used in compat headers, as these are standard member names or only can be used in our native header file signal.h.
This commit is contained in:
parent
899db1aa12
commit
22847b1b84
@ -1139,43 +1139,44 @@ svr4_setinfo(p, st, s)
|
||||
|
||||
memset(&i, 0, sizeof(i));
|
||||
|
||||
i.si_signo = SVR4_SIGCHLD;
|
||||
i.si_errno = 0; /* XXX? */
|
||||
i.svr4_si_signo = SVR4_SIGCHLD;
|
||||
i.svr4_si_errno = 0; /* XXX? */
|
||||
|
||||
if (p) {
|
||||
i.si_pid = p->p_pid;
|
||||
i.svr4_si_pid = p->p_pid;
|
||||
PROC_LOCK(p);
|
||||
calcru(p, &utime, &stime);
|
||||
PROC_UNLOCK(p);
|
||||
i.si_stime = stime.tv_sec;
|
||||
i.si_utime = utime.tv_sec;
|
||||
i.svr4_si_stime = stime.tv_sec;
|
||||
i.svr4_si_utime = utime.tv_sec;
|
||||
}
|
||||
|
||||
if (WIFEXITED(st)) {
|
||||
i.si_status = WEXITSTATUS(st);
|
||||
i.si_code = SVR4_CLD_EXITED;
|
||||
i.svr4_si_status = WEXITSTATUS(st);
|
||||
i.svr4_si_code = SVR4_CLD_EXITED;
|
||||
} else if (WIFSTOPPED(st)) {
|
||||
sig = WSTOPSIG(st);
|
||||
if (sig >= 0 && sig < NSIG)
|
||||
i.si_status = SVR4_BSD2SVR4_SIG(sig);
|
||||
i.svr4_si_status = SVR4_BSD2SVR4_SIG(sig);
|
||||
|
||||
if (i.si_status == SVR4_SIGCONT)
|
||||
i.si_code = SVR4_CLD_CONTINUED;
|
||||
if (i.svr4_si_status == SVR4_SIGCONT)
|
||||
i.svr4_si_code = SVR4_CLD_CONTINUED;
|
||||
else
|
||||
i.si_code = SVR4_CLD_STOPPED;
|
||||
i.svr4_si_code = SVR4_CLD_STOPPED;
|
||||
} else {
|
||||
sig = WTERMSIG(st);
|
||||
if (sig >= 0 && sig < NSIG)
|
||||
i.si_status = SVR4_BSD2SVR4_SIG(sig);
|
||||
i.svr4_si_status = SVR4_BSD2SVR4_SIG(sig);
|
||||
|
||||
if (WCOREDUMP(st))
|
||||
i.si_code = SVR4_CLD_DUMPED;
|
||||
i.svr4_si_code = SVR4_CLD_DUMPED;
|
||||
else
|
||||
i.si_code = SVR4_CLD_KILLED;
|
||||
i.svr4_si_code = SVR4_CLD_KILLED;
|
||||
}
|
||||
|
||||
DPRINTF(("siginfo [pid %ld signo %d code %d errno %d status %d]\n",
|
||||
i.si_pid, i.si_signo, i.si_code, i.si_errno, i.si_status));
|
||||
i.svr4_si_pid, i.svr4_si_signo, i.svr4_si_code, i.svr4_si_errno,
|
||||
i.svr4_si_status));
|
||||
|
||||
return copyout(&i, s, sizeof(i));
|
||||
}
|
||||
|
@ -96,16 +96,16 @@ typedef union svr4_siginfo {
|
||||
} _info;
|
||||
} svr4_siginfo_t;
|
||||
|
||||
#define si_signo _info._signo
|
||||
#define si_code _info._code
|
||||
#define si_errno _info._errno
|
||||
#define svr4_si_signo _info._signo
|
||||
#define svr4_si_code _info._code
|
||||
#define svr4_si_errno _info._errno
|
||||
|
||||
#define si_pid _info._reason._child._pid
|
||||
#define si_stime _info._reason._child._stime
|
||||
#define si_status _info._reason._child._status
|
||||
#define si_utime _info._reason._child._utime
|
||||
#define svr4_si_pid _info._reason._child._pid
|
||||
#define svr4_si_stime _info._reason._child._stime
|
||||
#define svr4_si_status _info._reason._child._status
|
||||
#define svr4_si_utime _info._reason._child._utime
|
||||
|
||||
#define si_addr _info._reason._fault._addr
|
||||
#define si_trap _info._reason._fault._trap
|
||||
#define svr4_si_addr _info._reason._fault._addr
|
||||
#define svr4_si_trap _info._reason._fault._trap
|
||||
|
||||
#endif /* !_SVR4_SIGINFO_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user