diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2025-09-21 12:36:52 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska-skaware@skarnet.org> | 2025-09-21 12:36:52 +0000 |
| commit | 0efd4cf8041f107a4460cfefa16667ee012e85d3 (patch) | |
| tree | 0d91a24a3965d4739d2a89779506b91c63ebe744 /src/repo/s6-rc-set-delete.c | |
| parent | 8671af033b2f5512e9138cbadcfc068b3ae3e135 (diff) | |
| download | s6-rc-0efd4cf8041f107a4460cfefa16667ee012e85d3.tar.gz | |
Add s6-rc-set-commit, slightly rephrase other binaries
Diffstat (limited to 'src/repo/s6-rc-set-delete.c')
| -rw-r--r-- | src/repo/s6-rc-set-delete.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/repo/s6-rc-set-delete.c b/src/repo/s6-rc-set-delete.c index 2750abb..48a81f0 100644 --- a/src/repo/s6-rc-set-delete.c +++ b/src/repo/s6-rc-set-delete.c @@ -77,7 +77,7 @@ enum gola_e GOLA_N } ; -static gol_arg const rgola[2] = +static gol_arg const rgola[] = { { .so = 'v', .lo = "verbosity", .i = GOLA_VERBOSITY }, { .so = 'r', .lo = "repodir", .i = GOLA_REPODIR } @@ -85,18 +85,18 @@ static gol_arg const rgola[2] = int main (int argc, char const *const *argv) { - char const *repo = S6RC_REPO_BASE ; int fdlock ; unsigned int verbosity = 1 ; - char const *wgola[2] = { 0 } ; + char const *wgola[GOLA_N] = { 0 } ; unsigned int golc ; PROG = "s6-rc-set-delete" ; + wgola[GOLA_REPODIR] = S6RC_REPO_BASE ; + golc = gol_main(argc, argv, 0, 0, rgola, 2, 0, wgola) ; argc -= golc ; argv += golc ; if (wgola[GOLA_VERBOSITY] && !uint0_scan(wgola[GOLA_VERBOSITY], &verbosity)) strerr_dief1x(100, "verbosity needs to be an unsigned integer") ; - if (wgola[GOLA_REPODIR]) repo = wgola[GOLA_REPODIR] ; if (!argc) dieusage() ; for (unsigned int i = 0 ; i < argc ; i++) { @@ -108,11 +108,11 @@ int main (int argc, char const *const *argv) strerr_dief2x(100, "set names cannot ", "contain / or newlines") ; } - fdlock = s6rc_repo_lock(repo, 1) ; - if (fdlock == -1) strerr_diefu2sys(111, "lock ", repo) ; + fdlock = s6rc_repo_lock(wgola[GOLA_REPODIR], 1) ; + if (fdlock == -1) strerr_diefu2sys(111, "lock ", wgola[GOLA_REPODIR]) ; tain_now_g() ; for (unsigned int i = 0 ; i < argc ; i++) - dodelete(repo, argv[i]) ; - return 0 ; + dodelete(wgola[GOLA_REPODIR], argv[i]) ; + _exit(0) ; } |
