diff --git a/.gitignore b/.gitignore index 37dbe946..e57df44a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,10 @@ *~ -*.o - *.diff *.orig *.patch -*.plist *.rej - core .gdb_history .gdbinit - # Meson build /builddir diff --git a/SNAPSHOT.h b/SNAPSHOT.h deleted file mode 100644 index cf241d92..00000000 --- a/SNAPSHOT.h +++ /dev/null @@ -1 +0,0 @@ -#define SNAPSHOT "s20180629" diff --git a/builddir/.placeholder b/builddir/.placeholder deleted file mode 100644 index e69de29b..00000000 diff --git a/doc/.gitignore b/doc/.gitignore deleted file mode 100644 index 085639f5..00000000 --- a/doc/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.html -*.8 diff --git a/meson.build b/meson.build index da83c0b4..f8f6e9b7 100644 --- a/meson.build +++ b/meson.build @@ -69,10 +69,11 @@ endif opt = get_option('USE_IDN') if opt == true idn_dep = cc.find_library('idn2', required : false) - if idn_dep.found() - add_project_arguments('-DUSE_IDN', language : 'c') - conf.set('USE_IDN', 1, description : 'If set use Internationalized Domain Name library.') - endif + if idn_dep.found() + add_project_arguments('-DUSE_IDN', language : 'c') + conf.set('USE_IDN', 1, + description : 'If set use Internationalized Domain Name library.') + endif else idn_dep = dependency('disabler-appears-to-disable-executable-build', required : false) endif @@ -89,7 +90,8 @@ elif opt == 'openssl' conf.set('USE_OPENSSL', 1, description : 'if set use openssl crypto library.') elif opt == 'none' crypto_dep = dependency('disabler-appears-to-disable-executable-build', required : false) - conf.set('PING6_NONCE_MEMORY', 1, description : 'If set RFC6744 random does not use any CRYPTO lib.') + conf.set('PING6_NONCE_MEMORY', 1, + description : 'If set RFC6744 random does not use any CRYPTO lib.') endif systemd = dependency('systemd', required : false) @@ -135,7 +137,6 @@ if build_ninfod == true 'netinet/in.h', 'netinet/ip6.h', 'openssl/md5.h', - 'pthread.h', 'pwd.h', 'string.h', 'strings.h', @@ -154,11 +155,8 @@ if build_ninfod == true endforeach threads = dependency('threads') if threads.found() - # FIXME: these are redundant, one should be removed. conf.set('ENABLE_THREADS', 1, description : 'Defined if libpthread is found.') - conf.set('HAVE_LIBPTHREAD', 1, - description : 'Defined if libpthread is found.') endif opt = get_option('NINFOD_MESSAGES') if opt == true diff --git a/meson_options.txt b/meson_options.txt index a14a4d7f..80fce5e8 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -4,7 +4,8 @@ option('USE_CAP', type : 'boolean', value : true, option('USE_IDN', type : 'boolean', value : true, description : 'IDN support (with libidn2)') -option('USE_CRYPTO', type : 'combo', choices : [ 'none', 'gcrypt', 'nettle', 'openssl' ], value : 'openssl', +option('USE_CRYPTO', type : 'combo', + choices : [ 'none', 'gcrypt', 'nettle', 'openssl' ], value : 'openssl', description: 'Crypto library support for ping6') option('BUILD_ARPING', type : 'boolean', value : true, diff --git a/ninfod/ninfod_core.c b/ninfod/ninfod_core.c index c618dba3..717ef614 100644 --- a/ninfod/ninfod_core.c +++ b/ninfod/ninfod_core.c @@ -44,7 +44,7 @@ # include # endif #endif -#if ENABLE_THREADS && HAVE_PTHREAD_H +#if ENABLE_THREADS # include #endif #if HAVE_STRING_H @@ -110,7 +110,7 @@ /* Variables */ int initialized = 0; -#if ENABLE_THREADS && HAVE_LIBPTHREAD +#if ENABLE_THREADS pthread_attr_t pattr; #endif @@ -397,7 +397,7 @@ void init_core(int forced) srand(seed); -#if ENABLE_THREADS && HAVE_LIBPTHREAD +#if ENABLE_THREADS if (initialized) pthread_attr_destroy(&pattr); @@ -425,7 +425,7 @@ void init_core(int forced) return; } -#if ENABLE_THREADS && HAVE_LIBPTHREAD +#if ENABLE_THREADS static void *ni_send_thread(void *data) { #if ENABLE_DEBUG @@ -511,7 +511,7 @@ int pr_nodeinfo(struct packetcontext *p) int i; char *cp; #endif -#if ENABLE_THREADS && HAVE_PTHREAD_H +#if ENABLE_THREADS pthread_t thread; #endif int rc; @@ -669,7 +669,7 @@ int pr_nodeinfo(struct packetcontext *p) /* Step 10: Send the reply * XXX: with possible random delay */ -#if ENABLE_THREADS && HAVE_LIBPTHREAD +#if ENABLE_THREADS /* ni_send_thread() frees p */ if (pthread_create(&thread, &pattr, ni_send_thread, p)) { free(p->replydata); diff --git a/ping.c b/ping.c index 69f7b30f..78977ea7 100644 --- a/ping.c +++ b/ping.c @@ -214,7 +214,7 @@ static double ping_strtod(const char *str, const char *err_msg) if (errno == ERANGE) error(2, errno, "%s: %s", err_msg, str); error(2, 0, "%s: %s", err_msg, str); - return num; + return 0.0; } int