diff options
author | Sergey Poznyakoff <gray@nxc.no> | 2013-11-15 15:40:24 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@nxc.no> | 2013-11-15 15:40:24 +0200 |
commit | f2ee64c64dac52da9e4956b8b64cfaa48ea97266 (patch) | |
tree | e002abfc04413942eaa7369d0a71c25c37d7fc92 | |
parent | c08b162bba5c545083315db303b7c73fd8ad3991 (diff) | |
download | jumper-f2ee64c64dac52da9e4956b8b64cfaa48ea97266.tar.gz jumper-f2ee64c64dac52da9e4956b8b64cfaa48ea97266.tar.bz2 |
Accept EX+N as exit code in onevent statement.
-rw-r--r-- | doc/jumper.8in | 14 | ||||
-rw-r--r-- | src/config.c | 7 |
2 files changed, 21 insertions, 0 deletions
diff --git a/doc/jumper.8in b/doc/jumper.8in index 77dd245..3762d0a 100644 --- a/doc/jumper.8in +++ b/doc/jumper.8in @@ -554,6 +554,20 @@ Decimal number in range \fB0..127\fR The action is performed when the command terminates with the given code. .TP +.BI EX+ N +The action is performed when the command terminates with the +code \fIN\fR. +.TP +Symbolic name of exit code from \fBsysexits.h\fR +The action is performed when the command terminates with the +given exit code. Currently the following symbolic names are used: +\fBEX_OK\fR (0), \fBEX_USAGE\fR (64), \fBEX_DATAERR\fR (65), +\fBEX_NOINPUT\fR (66), \fBEX_NOUSER\fR (67), \fBEX_NOHOST\fR (68), +\fBEX_UNAVAILABLE\fR (69), \fBEX_SOFTWARE\fR (70), \fBEX_OSERR\fR +(71), \fBEX_OSFILE\fR (72), \fBEX_CANTCREAT\fR (73), +\fBEX_IOERR\fR (74), \fBEX_TEMPFAIL\fR (75), \fBEX_PROTOCOL\fR (76), +\fBEX_NOPERM\fR (77), and \fBEX_CONFIG\fR (78). +.TP .BI SIG+ N The action is performed when the command terminates on signal \fIN\fR (decimal number) diff --git a/src/config.c b/src/config.c index 334851e..be5dd21 100644 --- a/src/config.c +++ b/src/config.c @@ -466,6 +466,13 @@ parse_event(grecs_value_t *val) type = event_exit; } else if (trans_strtotok(sig_trans, arg, &code) == 0) { type = event_signal; + } else if (strncmp(arg, "EX+", 3) == 0) { + code = strtoul(arg+3, &p, 10); + if (*p) { + grecs_error(&val->locus, 0, "invalid exit code"); + return NULL; + } + type = event_exit; } else if (strncmp(arg, "SIG+", 4) == 0) { code = strtoul(arg+4, &p, 10); if (*p) { |