From 3534b428629be185e096be99e3bd5fdfe32d5544 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 18 Sep 2014 18:55:44 +0000 Subject: initial commit with rc for skalibs-2.0.0.0 --- src/librandom/randomegd_open.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/librandom/randomegd_open.c (limited to 'src/librandom/randomegd_open.c') diff --git a/src/librandom/randomegd_open.c b/src/librandom/randomegd_open.c new file mode 100644 index 0000000..7c43f0d --- /dev/null +++ b/src/librandom/randomegd_open.c @@ -0,0 +1,20 @@ +/* ISC license. */ + +#include +#include +#include +#include + +int randomegd_open (char const *path) +{ + int s = ipc_stream() ; + if (s < 0) return -1 ; + if (ipc_connect(s, path) == -1) + { + register int e = errno ; + fd_close(s) ; + errno = e ; + return -1 ; + } + return s ; +} -- cgit v1.3.1