summaryrefslogtreecommitdiff
path: root/src/skaembutils/s6-update-symlinks.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2016-10-14 17:18:51 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2016-10-14 17:18:51 +0000
commit39e9677791c00ac8dab9b8cabbf13ba639679e34 (patch)
treed297b58906b9cc24cf4e4ad3f1cc958eece708a2 /src/skaembutils/s6-update-symlinks.c
parent44e07b7ac6b060d889fb6d097956c0ca4150662c (diff)
downloads6-portable-utils-39e9677791c00ac8dab9b8cabbf13ba639679e34.tar.xz
Port to new librandom API
Diffstat (limited to 'src/skaembutils/s6-update-symlinks.c')
-rw-r--r--src/skaembutils/s6-update-symlinks.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/skaembutils/s6-update-symlinks.c b/src/skaembutils/s6-update-symlinks.c
index ba89b06..91d76fa 100644
--- a/src/skaembutils/s6-update-symlinks.c
+++ b/src/skaembutils/s6-update-symlinks.c
@@ -51,7 +51,7 @@ static int makeuniquename (stralloc *sa, char const *path, char const *magic)
int wasnull = !sa->s ;
if (!stralloc_cats(sa, path)) return 0 ;
if (!stralloc_cats(sa, magic)) goto err ;
- if (random_sauniquename(sa, 8) == -1) goto err ;
+ if (!random_sauniquename(sa, 8)) goto err ;
if (!stralloc_0(sa)) goto err ;
return 1 ;
@@ -307,6 +307,8 @@ int main (int argc, char *const *argv)
while (i && (argv[1][i-1] == '/')) argv[1][--i] = 0 ;
if (!i) strerr_diefu1x(100, "replace root directory") ;
}
+ if (!random_init())
+ strerr_diefu1sys(111, "init random generator") ;
if (!makeuniquename(&blah.dst, argv[1], MAGICNEW))
strerr_diefu2sys(111, "make random unique name based on ", argv[1]) ;
if ((unlink(blah.dst.s) == -1) && (errno != ENOENT))