diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2016-10-14 17:18:08 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2016-10-14 17:18:08 +0000 |
commit | aa2fbb49df30a01805501ef3ea7f170c9ddf8256 (patch) | |
tree | 3d2c3e0bf362fb4678777ded33fb4e5d7d808df2 /src | |
parent | 9308bc100681fdb0fd87c0536c1c8fcb266c53e9 (diff) | |
download | s6-rc-aa2fbb49df30a01805501ef3ea7f170c9ddf8256.tar.xz |
Port to new librandom API
Diffstat (limited to 'src')
-rw-r--r-- | src/s6-rc/s6-rc-update.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/s6-rc/s6-rc-update.c b/src/s6-rc/s6-rc-update.c index a43d165..a0db0d5 100644 --- a/src/s6-rc/s6-rc-update.c +++ b/src/s6-rc/s6-rc-update.c @@ -334,7 +334,7 @@ static inline void make_new_livedir (unsigned char const *oldstate, s6rc_db_t co if (sareadlink(&satmp, live) < 0) strerr_diefu2sys(111, "readlink ", live) ; if (!s6rc_sanitize_dir(sa, live, &dirlen)) dienomem() ; llen = sa->len ; - if (random_sauniquename(sa, 8) < 0 || !stralloc_0(sa)) dienomem() ; + if (!random_sauniquename(sa, 8)) || !stralloc_0(sa)) dienomem() ; newlen = --sa->len ; if (mkdir(sa->s + sabase, 0755) < 0) strerr_diefu2sys(111, "mkdir ", sa->s + sabase) ; { @@ -640,6 +640,10 @@ int main (int argc, char const *const *argv, char const *const *envp) if (live[0] != '/') strerr_dief2x(100, live, " is not an absolute path") ; livelen = str_len(live) ; + + if (!random_init()) + strerr_diefu1sys(111, "init random generator") ; + { int livelock, oldlock, newlock ; int fdoldc, fdnewc ; |