From 4a90dd1f9063fd5a91431ee6873c25c5c8229805 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 14 Oct 2016 17:16:43 +0000 Subject: Port to the new librandom API --- src/libs6/ftrig1_make.c | 2 +- src/libs6/s6-ftrigrd.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/libs6') diff --git a/src/libs6/ftrig1_make.c b/src/libs6/ftrig1_make.c index 7aedd08..83ffca9 100644 --- a/src/libs6/ftrig1_make.c +++ b/src/libs6/ftrig1_make.c @@ -25,7 +25,7 @@ int ftrig1_make (ftrig1_t *f, char const *path) tmp[pathlen + 2 + FTRIG1_PREFIXLEN] = ':' ; if (!timestamp(tmp + pathlen + 3 + FTRIG1_PREFIXLEN)) return 0 ; tmp[pathlen + 28 + FTRIG1_PREFIXLEN] = ':' ; - if (random_name(tmp + pathlen + 29 + FTRIG1_PREFIXLEN, 16) < 16) return 0 ; + random_name(tmp + pathlen + 29 + FTRIG1_PREFIXLEN, 16) ; tmp[pathlen + 45 + FTRIG1_PREFIXLEN] = 0 ; { diff --git a/src/libs6/s6-ftrigrd.c b/src/libs6/s6-ftrigrd.c index b4c4c86..3200300 100644 --- a/src/libs6/s6-ftrigrd.c +++ b/src/libs6/s6-ftrigrd.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -194,6 +195,8 @@ int main (void) if (ndelay_on(0) < 0) strerr_diefu2sys(111, "ndelay_on ", "0") ; if (ndelay_on(1) < 0) strerr_diefu2sys(111, "ndelay_on ", "1") ; if (sig_ignore(SIGPIPE) < 0) strerr_diefu1sys(111, "ignore SIGPIPE") ; + if (!random_init()) + strerr_diefu1sys(111, "init random generator") ; { tain_t deadline ; -- cgit v1.2.3