#include "config.h"
#include <string.h>
#include <sys/time.h>
+#include <sys/stat.h>
+#include <errno.h>
#include "sldns/sbuffer.h"
#include "util/config_file.h"
#include "util/net_help.h"
}
}
+/* check that the socket file can be opened and exists, print error if not */
+static void
+check_socket_file(const char* socket_path)
+{
+ struct stat statbuf;
+ memset(&statbuf, 0, sizeof(statbuf));
+ if(stat(socket_path, &statbuf) < 0) {
+ log_warn("could not open dnstap-socket-path: %s, %s",
+ socket_path, strerror(errno));
+ }
+}
+
struct dt_env *
dt_create(const char *socket_path, unsigned num_workers)
{
socket_path);
log_assert(socket_path != NULL);
log_assert(num_workers > 0);
+ check_socket_file(socket_path);
env = (struct dt_env *) calloc(1, sizeof(struct dt_env));
if (!env)
22 October 2018: Wouter
- Fix #4192: unbound-control-setup generates keys not readable by
group.
+ - check that the dnstap socket file can be opened and exists, print
+ error if not.
22 October 2018: Ralph
- Change fast-server-num default to 3.