s/qmail
4.3.20
Next generation secure email transport
Loading...
Searching...
No Matches
4.3
sqmail-4.3.20
src
except.c
Go to the documentation of this file.
1
#include <unistd.h>
2
#include "wait.h"
3
#include "logmsg.h"
4
#include "
exit.h
"
5
6
#define WHO "except"
7
8
int
main
(
int
argc,
char
*
const
*argv)
9
{
10
int
pid;
11
int
wstat;
12
13
if
(!argv[1])
14
logmsg(
WHO
,100,USAGE,
"except program [ arg ... ]"
);
15
16
pid = fork();
17
if
(pid == -1)
18
logmsg(
WHO
,111,FATAL,
"unable to fork: "
);
19
if
(pid == 0) {
20
execvp(argv[1],argv + 1);
21
if
(errno)
_exit
(111);
22
_exit
(100);
23
}
24
25
if
(wait_pid(&wstat,pid) == -1)
26
logmsg(
WHO
,111,FATAL,
"wait failed"
);
27
if
(wait_crashed(wstat))
28
logmsg(
WHO
,111,FATAL,
"child crashed"
);
29
switch
(wait_exitcode(wstat)) {
30
case
0:
_exit
(100);
31
case
111: logmsg(
WHO
,111,FATAL,
"temporary child error"
);
32
default
:
_exit
(0);
33
}
34
}
main
int main()
Definition:
chkshsgr.c:6
WHO
#define WHO
Definition:
except.c:6
exit.h
_exit
void _exit(int)
Generated on Thu Jan 16 2025 17:42:03 for s/qmail by
1.9.6