From 3b9836248ed7f5164140d63e96ece21973fc43f7 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 21 Oct 2025 18:03:48 +0000 Subject: add getserviceflags and use it in fillset; add some doc --- src/libs6rc/s6rc_repo_sync.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/libs6rc/s6rc_repo_sync.c') diff --git a/src/libs6rc/s6rc_repo_sync.c b/src/libs6rc/s6rc_repo_sync.c index 2ec1356..9458dcb 100644 --- a/src/libs6rc/s6rc_repo_sync.c +++ b/src/libs6rc/s6rc_repo_sync.c @@ -53,13 +53,13 @@ int s6rc_repo_sync (char const *repo, unsigned int verbosity, char const *fdhuse { strerr_warnfu2sys("mkdtemp ", ato) ; umask(m) ; - return 0 ; + return -1 ; } if (chmod(ato, 02755) == -1) { strerr_warnfu2sys("chmod ", ato) ; umask(m) ; - return 0 ; + return -1 ; } if (!mkdtemp(bun)) @@ -67,13 +67,13 @@ int s6rc_repo_sync (char const *repo, unsigned int verbosity, char const *fdhuse strerr_warnfu2sys("mkdtemp ", bun) ; rmdir(ato) ; umask(m) ; - return 0 ; + return -1 ; } umask(m) ; if (chmod(bun, 02755) == -1) { strerr_warnfu2sys("chmod ", bun) ; - return 0 ; + return -1 ; } for (uint16_t istore = 0 ;; istore++) @@ -159,7 +159,8 @@ int s6rc_repo_sync (char const *repo, unsigned int verbosity, char const *fdhuse char const *subs[2] = { ato + repolen + 9, bun + repolen + 9 } ; char oldc[repolen + 49] ; int r = s6rc_repo_compile(repo, ".ref", subs, 2, oldc, verbosity, fdhuser) ; - if (r <= 0) goto err ; + if (r < 0) goto err ; + if (!r) { cleanup(ato, bun) ; return 0 ; } if (r == 2) rm_rf(oldc) ; } @@ -201,7 +202,7 @@ int s6rc_repo_sync (char const *repo, unsigned int verbosity, char const *fdhuse if (!dir) { strerr_warnfu2sys("opendir ", ato) ; - return 0 ; + return -1 ; } for (;;) { @@ -218,7 +219,7 @@ int s6rc_repo_sync (char const *repo, unsigned int verbosity, char const *fdhuse if (errno) { strerr_warnfu2sys("readdir ", ato) ; - return 0 ; + return -1 ; } } @@ -226,5 +227,5 @@ int s6rc_repo_sync (char const *repo, unsigned int verbosity, char const *fdhuse err: cleanup(ato, bun) ; - return 0 ; + return -1 ; } -- cgit v1.3.1