logswan

Fast Web log analyzer using probabilistic data structures
Log | Files | Refs | README | LICENSE

commit 4944db5272cd98615662190509bb1d0778589cc6
parent 8aac9f4230c7a43d3d7d519d3dc6284f2c3acb5f
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date:   Wed, 30 Dec 2015 12:02:15 +0100

Initial support for using pledge() on OpenBSD

Diffstat:
Msrc/logswan.c | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/logswan.c b/src/logswan.c @@ -15,11 +15,14 @@ #include <netinet/in.h> #include <sys/socket.h> #include <sys/stat.h> +#include <err.h> +#include <errno.h> #include <getopt.h> #include <inttypes.h> #include <stdio.h> #include <stdlib.h> #include <time.h> +#include <unistd.h> #ifndef HAVE_STRTONUM #include "../compat/strtonum.h" @@ -73,6 +76,13 @@ void displayUsage() { int main (int argc, char *argv[]) { char *intputFile; + + #if defined(__OpenBSD__) + if (pledge("stdio rpath", NULL) == -1) { + err(EXIT_FAILURE, "pledge"); + } + #endif + hll_init(&uniqueIPv4, HLL_BITS); hll_init(&uniqueIPv6, HLL_BITS);