summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-09-21 15:07:50 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-09-21 15:07:50 +0000
commitdb7ece825a701b71906f29dce2da4287144abb85 (patch)
tree0fc9c5d3dc5075bb352408e59f9ad4b0fa091124 /src
parent10d06f7d21b7ab7400ea94936712d7dcb2ed94ca (diff)
downloads6-rc-db7ece825a701b71906f29dce2da4287144abb85.tar.xz
Trivial bugfixes in s6-rc-oneshot-run
Diffstat (limited to 'src')
-rw-r--r--src/s6-rc/s6-rc-oneshot-run.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/s6-rc/s6-rc-oneshot-run.c b/src/s6-rc/s6-rc-oneshot-run.c
index 60834c8..becdf7b 100644
--- a/src/s6-rc/s6-rc-oneshot-run.c
+++ b/src/s6-rc/s6-rc-oneshot-run.c
@@ -16,7 +16,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
char const *live = S6RC_LIVE_BASE ;
unsigned int number ;
int up ;
- PROG = "s6-rc-db" ;
+ PROG = "s6-rc-oneshot-run" ;
{
subgetopt_t l = SUBGETOPT_ZERO ;
for (;;)
@@ -59,8 +59,8 @@ int main (int argc, char const *const *argv, char const *const *envp)
if (!s6rc_db_read_sizes(fdcompiled, &db))
strerr_diefu3sys(111, "read ", compiled, "/n") ;
- if (number >= db.nshort)
- strerr_dief1x(3, "invalid oneshot number") ;
+ if (number < db.nlong || number >= db.nlong + db.nshort)
+ strerr_dief1x(3, "invalid service number") ;
/* Allocate enough stack for the db */