aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs6rc/s6rc_repo_makesetbundles.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs6rc/s6rc_repo_makesetbundles.c')
-rw-r--r--src/libs6rc/s6rc_repo_makesetbundles.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/libs6rc/s6rc_repo_makesetbundles.c b/src/libs6rc/s6rc_repo_makesetbundles.c
index 30ff29e..8fcf979 100644
--- a/src/libs6rc/s6rc_repo_makesetbundles.c
+++ b/src/libs6rc/s6rc_repo_makesetbundles.c
@@ -14,13 +14,9 @@
#include <skalibs/genalloc.h>
#include <skalibs/djbunix.h>
+#include <s6-rc/s6rc-utils.h>
#include <s6-rc/repo.h>
-static int str_ref_cmp (void const *a, void const *b)
-{
- return strcmp(*(char const *const *)a, *(char const *const *)b) ;
-}
-
int s6rc_repo_makesetbundles (char const *repo, char const *set, unsigned int verbosity)
{
size_t repolen = strlen(repo) ;
@@ -49,7 +45,7 @@ int s6rc_repo_makesetbundles (char const *repo, char const *set, unsigned int ve
for (size_t i = 0 ; i < n ; i++) masked[i] = maskedstorage + genalloc_s(size_t, &ga)[i] ;
sa.len = 0 ;
genalloc_setlen(size_t, &ga, 0) ;
- qsort(masked, n, sizeof(char const *), &str_ref_cmp) ;
+ qsort(masked, n, sizeof(char const *), &s6rc_strrefcmp) ;
if (mkdir(dst, 02755) == -1)
{
@@ -83,7 +79,7 @@ int s6rc_repo_makesetbundles (char const *repo, char const *set, unsigned int ve
for (; i < m ; i++)
{
char const *x = sa.s + genalloc_s(size_t, &ga)[i] ;
- if (bsearch(x, masked, n, sizeof(char const *), &str_ref_cmp))
+ if (bsearch(x, masked, n, sizeof(char const *), &s6rc_strrefcmp))
{
if (verbosity >= 3)
strerr_warni4x("skipping bundle ", d->d_name, " containing e.g. masked service ", x) ;