diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2015-01-19 16:11:24 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2015-01-19 16:11:24 +0000 |
commit | 701540827e27a4f07ac725db3ce361d3be0c106f (patch) | |
tree | 98c4b2fb8ba8f69ef791feebdcd61cd5bca34140 /src/libs6/s6_svc_main.c | |
parent | 83853a80eb18238796154164f9ea776b0c167ab7 (diff) | |
download | s6-701540827e27a4f07ac725db3ce361d3be0c106f.tar.xz |
- added the s6_fdholder library to libs6. (Nothing useful yet.)
- fixed execline invocation in s6-log with slashpackage
- integrated s6_svc_main.c's functionality into s6-svscanctl and deleted it
- integrated Olivier Brunel's suggestions for wstat report in supervise/status
- minor fixes to s6-supervise's status reports
- separated sigaction calls in ftrigw_notifyb, this spares a few syscalls in s6-supervise
- updated doc to reflect the changes
- version bumped to 2.1.0.0 because API breakage (./finish, s6-svstat)
Diffstat (limited to 'src/libs6/s6_svc_main.c')
-rw-r--r-- | src/libs6/s6_svc_main.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/libs6/s6_svc_main.c b/src/libs6/s6_svc_main.c deleted file mode 100644 index ead74cd..0000000 --- a/src/libs6/s6_svc_main.c +++ /dev/null @@ -1,39 +0,0 @@ -/* ISC license. */ - -#include <skalibs/bytestr.h> -#include <skalibs/sgetopt.h> -#include <skalibs/strerr2.h> -#include <s6/s6-supervise.h> - -#define DATASIZE 256 - -int s6_svc_main (int argc, char const *const *argv, char const *optstring, char const *usage, char const *controldir) -{ - char data[DATASIZE] ; - unsigned int datalen = 0 ; - register int r ; - for (;;) - { - register int opt = subgetopt(argc, argv, optstring) ; - if (opt == -1) break ; - if (opt == '?') strerr_dieusage(100, usage) ; - if (datalen >= DATASIZE) strerr_dief1x(100, "too many commands") ; - data[datalen++] = opt ; - } - argc -= subgetopt_here.ind ; argv += subgetopt_here.ind ; - if (!argc) strerr_dieusage(100, usage) ; - - { - unsigned int arglen = str_len(*argv) ; - unsigned int cdirlen = str_len(controldir) ; - char tmp[arglen + cdirlen + 10] ; - byte_copy(tmp, arglen, *argv) ; - tmp[arglen] = '/' ; - byte_copy(tmp + arglen + 1, cdirlen, controldir) ; - byte_copy(tmp + arglen + 1 + cdirlen, 9, "/control") ; - r = s6_svc_write(tmp, data, datalen) ; - } - if (r < 0) strerr_diefu2sys(111, "control ", *argv) ; - else if (!r) strerr_diefu3x(100, "control ", *argv, ": supervisor not listening") ; - return 0 ; -} |