aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs6rc/s6rc_repo_sync.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2025-10-21 18:03:48 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2025-10-21 18:03:48 +0000
commit3b9836248ed7f5164140d63e96ece21973fc43f7 (patch)
tree193242a4b634c84d712d8260e7707eae1be53601 /src/libs6rc/s6rc_repo_sync.c
parentd71f18b44e4168e2d942b503110af5b5314364b5 (diff)
downloads6-rc-3b9836248ed7f5164140d63e96ece21973fc43f7.tar.gz
add getserviceflags and use it in fillset; add some doc
Diffstat (limited to 'src/libs6rc/s6rc_repo_sync.c')
-rw-r--r--src/libs6rc/s6rc_repo_sync.c17
1 files changed, 9 insertions, 8 deletions
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 ;
}