diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2021-08-30 19:11:44 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2021-08-30 19:11:44 +0000 |
commit | 691c69e626e4ceb85567a5288348bd04378fd410 (patch) | |
tree | 9ae1c3f2c2984aafa2b9caf7987fe0011fcf6828 /src/supervision/s6-svdir-unlink.c | |
parent | 1719a60278cf36558b568349c0c9f9b5eb91c999 (diff) | |
download | s6-691c69e626e4ceb85567a5288348bd04378fd410.tar.xz |
s6-svlink, s6-svunlink, .h changes
Renamed from s6-svdir-(un)link.
Doc added. Full functionality added.
Still need to be tested.
Unrelated: .h names simplified.
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/supervision/s6-svdir-unlink.c')
-rw-r--r-- | src/supervision/s6-svdir-unlink.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/supervision/s6-svdir-unlink.c b/src/supervision/s6-svdir-unlink.c deleted file mode 100644 index 0e8699e..0000000 --- a/src/supervision/s6-svdir-unlink.c +++ /dev/null @@ -1,38 +0,0 @@ -/* ISC license. */ - -#include <stdint.h> - -#include <skalibs/sgetopt.h> -#include <skalibs/strerr2.h> - -#include <s6/s6-supervise.h> - -#define USAGE "s6-svdir-unlink [ -d ] [ -x ] scandir servicename" -#define dieusage() strerr_dieusage(100, USAGE) - -int main (int argc, char const *const *argv) -{ - uint32_t options = 0 ; - PROG = "s6-svdir-link" ; - { - subgetopt l = SUBGETOPT_ZERO ; - for (;;) - { - int opt = subgetopt_r(argc, argv, "dx", &l) ; - if (opt == -1) break ; - switch (opt) - { - case 'd' : options = 3 ; break ; - case 'x' : options = 1 ; break ; - default : dieusage() ; - } - } - argc -= l.ind ; argv += l.ind ; - } - if (argc < 2) dieusage() ; - - if (!argv[1][0] || argv[1][0] == '.' || argv[1][0] == '/') - strerr_dief1x(100, "invalid service name") ; - s6_supervise_unlink(argv[0], argv[1], options) ; - return 0 ; -} |