summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-11-20 13:28:01 +0000
committerng0 <ng0@n0.is>2019-11-20 13:28:01 +0000
commit13226e828c6b7d56c77444afe159c1ccf008d62d (patch)
tree012f078ef372530f02e2ff04e7b8e2cd0149c9e4
parent522a4b35a04b2bc8f50b25db8b9a30ef4ab9d9e2 (diff)
follow-up to 7c14b80a011e9e99b1cef0bfd96bae364edd5663:
use __linux__ instead of redefined LINUX.
-rw-r--r--src/arm/gnunet-service-arm.c8
-rw-r--r--src/include/platform.h2
-rw-r--r--src/nat-auto/gnunet-nat-server.c2
-rw-r--r--src/nat-auto/gnunet-service-nat-auto.c2
-rw-r--r--src/nat/gnunet-service-nat.c2
-rw-r--r--src/nse/gnunet-service-nse.c2
-rw-r--r--src/regex/gnunet-daemon-regexprofiler.c2
-rw-r--r--src/revocation/gnunet-service-revocation.c2
-rw-r--r--src/statistics/gnunet-service-statistics.c2
-rw-r--r--src/testbed/gnunet-service-testbed_cpustatus.c12
-rw-r--r--src/topology/gnunet-daemon-topology.c2
-rw-r--r--src/transport/gnunet-communicator-unix.c2
-rw-r--r--src/transport/gnunet-helper-transport-bluetooth.c12
-rw-r--r--src/transport/plugin_transport_tcp.c2
-rw-r--r--src/transport/plugin_transport_udp_broadcasting.c14
-rw-r--r--src/transport/plugin_transport_unix.c2
-rw-r--r--src/transport/tcp_connection_legacy.c2
-rw-r--r--src/transport/tcp_service_legacy.c4
-rw-r--r--src/transport/test_transport_api_reliability.c2
-rw-r--r--src/util/disk.c2
-rw-r--r--src/util/gnunet-service-resolver.c2
-rw-r--r--src/util/network.c2
-rw-r--r--src/util/os_installation.c6
-rw-r--r--src/util/test_bio.c4
24 files changed, 47 insertions, 47 deletions
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c
index 01bc48960..09d85ca89 100644
--- a/src/arm/gnunet-service-arm.c
+++ b/src/arm/gnunet-service-arm.c
@@ -301,7 +301,7 @@ add_unixpath (struct sockaddr **saddrs,
un = GNUNET_new (struct sockaddr_un);
un->sun_family = AF_UNIX;
GNUNET_strlcpy (un->sun_path, unixpath, sizeof(un->sun_path));
-#ifdef LINUX
+#ifdef __linux__
if (GNUNET_YES == abstract)
un->sun_path[0] = '\0';
#endif
@@ -455,7 +455,7 @@ get_server_addresses (const char *service_name,
unixpath = GNUNET_NETWORK_shorten_unixpath (unixpath);
LOG (GNUNET_ERROR_TYPE_INFO, _ ("Using `%s' instead\n"), unixpath);
}
-#ifdef LINUX
+#ifdef __linux__
abstract = GNUNET_CONFIGURATION_get_value_yesno (cfg,
"TESTING",
"USE_ABSTRACT_SOCKETS");
@@ -1081,7 +1081,7 @@ create_listen_socket (struct sockaddr *sa,
return;
}
if ((AF_UNIX == sa->sa_family)
-#ifdef LINUX
+#ifdef __linux__
/* Permission settings are not required when abstract sockets are used */
&& ('\0' != ((const struct sockaddr_un *) sa)->sun_path[0])
#endif
@@ -2188,7 +2188,7 @@ main (int argc, char *const *argv)
}
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
diff --git a/src/include/platform.h b/src/include/platform.h
index 976c9eac7..0cf4c9e5e 100644
--- a/src/include/platform.h
+++ b/src/include/platform.h
@@ -126,7 +126,7 @@
#include <semaphore.h>
#include <net/if.h>
#endif
-#if defined(LINUX) || defined(GNU)
+#if defined(__linux__) || defined(GNU)
#include <net/if.h>
#endif
#ifdef SOLARIS
diff --git a/src/nat-auto/gnunet-nat-server.c b/src/nat-auto/gnunet-nat-server.c
index 499893c70..b462b486f 100644
--- a/src/nat-auto/gnunet-nat-server.c
+++ b/src/nat-auto/gnunet-nat-server.c
@@ -381,7 +381,7 @@ GNUNET_SERVICE_MAIN
GNUNET_MQ_handler_end ());
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
diff --git a/src/nat-auto/gnunet-service-nat-auto.c b/src/nat-auto/gnunet-service-nat-auto.c
index 51c82f6b3..7d7c732a0 100644
--- a/src/nat-auto/gnunet-service-nat-auto.c
+++ b/src/nat-auto/gnunet-service-nat-auto.c
@@ -468,7 +468,7 @@ GNUNET_SERVICE_MAIN
GNUNET_MQ_handler_end ());
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
diff --git a/src/nat/gnunet-service-nat.c b/src/nat/gnunet-service-nat.c
index 9a70622c4..3b7d48c82 100644
--- a/src/nat/gnunet-service-nat.c
+++ b/src/nat/gnunet-service-nat.c
@@ -2063,7 +2063,7 @@ GNUNET_SERVICE_MAIN
GNUNET_MQ_handler_end ());
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c
index d16abed71..fa9a2e950 100644
--- a/src/nse/gnunet-service-nse.c
+++ b/src/nse/gnunet-service-nse.c
@@ -1579,7 +1579,7 @@ GNUNET_SERVICE_MAIN ("nse",
GNUNET_MQ_handler_end ());
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
diff --git a/src/regex/gnunet-daemon-regexprofiler.c b/src/regex/gnunet-daemon-regexprofiler.c
index fb061acc1..eda58fdd2 100644
--- a/src/regex/gnunet-daemon-regexprofiler.c
+++ b/src/regex/gnunet-daemon-regexprofiler.c
@@ -386,7 +386,7 @@ main (int argc, char *const *argv)
}
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
diff --git a/src/revocation/gnunet-service-revocation.c b/src/revocation/gnunet-service-revocation.c
index 456b3834a..51286f49b 100644
--- a/src/revocation/gnunet-service-revocation.c
+++ b/src/revocation/gnunet-service-revocation.c
@@ -946,7 +946,7 @@ GNUNET_SERVICE_MAIN
GNUNET_MQ_handler_end ());
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
diff --git a/src/statistics/gnunet-service-statistics.c b/src/statistics/gnunet-service-statistics.c
index ba6a614c8..5d58c3743 100644
--- a/src/statistics/gnunet-service-statistics.c
+++ b/src/statistics/gnunet-service-statistics.c
@@ -1042,7 +1042,7 @@ GNUNET_SERVICE_MAIN (
GNUNET_MQ_handler_end ());
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
diff --git a/src/testbed/gnunet-service-testbed_cpustatus.c b/src/testbed/gnunet-service-testbed_cpustatus.c
index 5eaeaf952..cd1878467 100644
--- a/src/testbed/gnunet-service-testbed_cpustatus.c
+++ b/src/testbed/gnunet-service-testbed_cpustatus.c
@@ -57,7 +57,7 @@ static processor_cpu_load_info_t prev_cpu_load;
#define DEBUG_STATUSCALLS GNUNET_NO
-#ifdef LINUX
+#ifdef __linux__
static FILE *proc_stat;
#endif
@@ -133,7 +133,7 @@ updateUsage ()
{
currentIOLoad = -1;
currentCPULoad = -1;
-#ifdef LINUX
+#ifdef __linux__
/* under linux, first try %idle/usage using /proc/stat;
if that does not work, disable /proc/stat for the future
by closing the file and use the next-best method. */
@@ -509,7 +509,7 @@ mem_get_usage ()
}
-#ifdef LINUX
+#ifdef __linux__
#include <dirent.h>
/**
* Returns the number of processes
@@ -557,7 +557,7 @@ sample_load_task (void *cls)
if ((-1 == ld_cpu) || (-1 == ld_disk))
goto reschedule;
mem_usage = mem_get_usage ();
-#ifdef LINUX
+#ifdef __linux__
nproc = get_nproc ();
#else
nproc = 0;
@@ -622,7 +622,7 @@ GST_stats_init (const struct GNUNET_CONFIGURATION_Handle *cfg)
}
GNUNET_free (fn);
sample_load_task_id = GNUNET_SCHEDULER_add_now (&sample_load_task, NULL);
-#ifdef LINUX
+#ifdef __linux__
proc_stat = fopen ("/proc/stat", "r");
if (NULL == proc_stat)
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
@@ -642,7 +642,7 @@ GST_stats_destroy ()
{
if (NULL == bw)
return;
-#ifdef LINUX
+#ifdef __linux__
if (proc_stat != NULL)
{
fclose (proc_stat);
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c
index 1b6004392..261d825ea 100644
--- a/src/topology/gnunet-daemon-topology.c
+++ b/src/topology/gnunet-daemon-topology.c
@@ -1135,7 +1135,7 @@ main (int argc, char *const *argv)
}
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
diff --git a/src/transport/gnunet-communicator-unix.c b/src/transport/gnunet-communicator-unix.c
index 2cfb802e3..58a144ecb 100644
--- a/src/transport/gnunet-communicator-unix.c
+++ b/src/transport/gnunet-communicator-unix.c
@@ -1105,7 +1105,7 @@ main (int argc, char *const *argv)
}
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
diff --git a/src/transport/gnunet-helper-transport-bluetooth.c b/src/transport/gnunet-helper-transport-bluetooth.c
index 74806e630..975af7068 100644
--- a/src/transport/gnunet-helper-transport-bluetooth.c
+++ b/src/transport/gnunet-helper-transport-bluetooth.c
@@ -115,7 +115,7 @@ struct SendBuffer
char buf[MAXLINE * 2];
};
-#ifdef LINUX
+#ifdef __linux__
/**
* Devices buffer used to keep a list with all the discoverable devices in
* order to send them HELLO messages one by one when it receive a broadcast message.
@@ -567,7 +567,7 @@ check_crc_buf_osdep (const unsigned char *buf, size_t len)
/* ************** end of clone ***************** */
-#ifdef LINUX
+#ifdef __linux__
/**
* Function for assigning a port number
*
@@ -795,7 +795,7 @@ read_from_the_socket (void *sock,
return -1;
}
- #ifdef LINUX
+ #ifdef __linux__
/* Get the channel used */
int len;
struct sockaddr_rc rc_addr = { 0 };
@@ -1012,7 +1012,7 @@ mac_set (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame *taIeeeHeader,
}
-#ifdef LINUX
+#ifdef __linux__
/**
* Test if the given interface name really corresponds to a bluetooth
* device.
@@ -1117,7 +1117,7 @@ stdin_send_hw (void *cls, const struct GNUNET_MessageHeader *hdr)
}
-#ifdef LINUX
+#ifdef __linux__
/**
* Broadcast a HELLO message for peer discovery
*
@@ -1382,7 +1382,7 @@ inquiry_devices: // skip the conditions and force a inquiry for new devices
int
main (int argc, char *argv[])
{
-#ifdef LINUX
+#ifdef __linux__
struct HardwareInfos dev;
char readbuf[MAXLINE];
int maxfd;
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c
index ad0766af9..4cec181b0 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -1166,7 +1166,7 @@ get_server_addresses (const char *service_name,
unixpath = GNUNET_NETWORK_shorten_unixpath (unixpath);
LOG (GNUNET_ERROR_TYPE_INFO, _ ("Using `%s' instead\n"), unixpath);
}
-#ifdef LINUX
+#ifdef __linux__
abstract = GNUNET_CONFIGURATION_get_value_yesno (cfg,
"TESTING",
"USE_ABSTRACT_SOCKETS");
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c
index c85124b68..5e72fad09 100644
--- a/src/transport/plugin_transport_udp_broadcasting.c
+++ b/src/transport/plugin_transport_udp_broadcasting.c
@@ -41,7 +41,7 @@
#define LOG(kind, ...) GNUNET_log_from (kind, "transport-udp", __VA_ARGS__)
/* *********** Cryogenic ********** */
-#if LINUX
+#if __linux__
#include <sys/stat.h>
#include <fcntl.h>
@@ -92,7 +92,7 @@ struct BroadcastAddress
socklen_t addrlen;
-#if LINUX
+#if __linux__
/**
* Cryogenic handle.
*/
@@ -277,7 +277,7 @@ udp_ipv4_broadcast_send (void *cls)
}
}
-#if LINUX
+#if __linux__
/*
* Cryogenic
*/
@@ -359,7 +359,7 @@ udp_ipv6_broadcast_send (void *cls)
GNUNET_a2s ((const struct sockaddr *) &plugin->ipv6_multicast_address,
sizeof(struct sockaddr_in6)));
}
-#if LINUX
+#if __linux__
/*
* Cryogenic
*/
@@ -448,7 +448,7 @@ iface_proc (void *cls,
(NULL != plugin->sockv4) &&
(addrlen == sizeof(struct sockaddr_in)))
{
-#if LINUX
+#if __linux__
/*
* setup Cryogenic FD for ipv4 broadcasting
*/
@@ -503,7 +503,7 @@ iface_proc (void *cls,
}
else
{
-#if LINUX
+#if __linux__
/*
* setup Cryogenic FD for ipv6 broadcasting
*/
@@ -632,7 +632,7 @@ stop_broadcast (struct Plugin *plugin)
}
}
-#if LINUX
+#if __linux__
GNUNET_DISK_file_close (p->cryogenic_fd);
#endif
GNUNET_CONTAINER_DLL_remove (plugin->broadcast_head,
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c
index 083a1cf7f..9d3e7d354 100644
--- a/src/transport/plugin_transport_unix.c
+++ b/src/transport/plugin_transport_unix.c
@@ -1755,7 +1755,7 @@ libgnunet_plugin_transport_unix_init (void *cls)
plugin->env = env;
/* Initialize my flags */
-#ifdef LINUX
+#ifdef __linux__
plugin->is_abstract =
GNUNET_CONFIGURATION_get_value_yesno (plugin->env->cfg,
"testing",
diff --git a/src/transport/tcp_connection_legacy.c b/src/transport/tcp_connection_legacy.c
index 8eea664c4..4e8c8140d 100644
--- a/src/transport/tcp_connection_legacy.c
+++ b/src/transport/tcp_connection_legacy.c
@@ -876,7 +876,7 @@ GNUNET_CONNECTION_create_from_connect_to_unixpath (
un = GNUNET_new (struct sockaddr_un);
un->sun_family = AF_UNIX;
GNUNET_strlcpy (un->sun_path, unixpath, sizeof(un->sun_path));
-#ifdef LINUX
+#ifdef __linux__
{
int abstract;
diff --git a/src/transport/tcp_service_legacy.c b/src/transport/tcp_service_legacy.c
index 54020b642..f207863f9 100644
--- a/src/transport/tcp_service_legacy.c
+++ b/src/transport/tcp_service_legacy.c
@@ -482,7 +482,7 @@ add_unixpath (struct sockaddr **saddrs,
un = GNUNET_new (struct sockaddr_un);
un->sun_family = AF_UNIX;
GNUNET_strlcpy (un->sun_path, unixpath, sizeof(un->sun_path));
-#ifdef LINUX
+#ifdef __linux__
if (GNUNET_YES == abstract)
un->sun_path[0] = '\0';
#endif
@@ -637,7 +637,7 @@ LEGACY_SERVICE_get_server_addresses (
unixpath = GNUNET_NETWORK_shorten_unixpath (unixpath);
LOG (GNUNET_ERROR_TYPE_INFO, _ ("Using `%s' instead\n"), unixpath);
}
-#ifdef LINUX
+#ifdef __linux__
abstract = GNUNET_CONFIGURATION_get_value_yesno (cfg,
"TESTING",
"USE_ABSTRACT_SOCKETS");
diff --git a/src/transport/test_transport_api_reliability.c b/src/transport/test_transport_api_reliability.c
index d8fd2046d..058d7d8bf 100644
--- a/src/transport/test_transport_api_reliability.c
+++ b/src/transport/test_transport_api_reliability.c
@@ -89,7 +89,7 @@ get_size (unsigned int iter)
size_t ret;
ret = (iter * iter * iter);
-#ifndef LINUX
+#ifndef __linux__
/* FreeBSD/OSX etc. Unix DGRAMs do not work
* with large messages */
if (0 == strcmp ("unix", ccc->test_plugin))
diff --git a/src/util/disk.c b/src/util/disk.c
index 866dbc301..2d5e353c8 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -1505,7 +1505,7 @@ GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h)
return GNUNET_SYSERR;
}
-#if ! defined(LINUX) || ! defined(GNU)
+#if ! defined(__linux__) || ! defined(GNU)
return fsync (h->fd) == -1 ? GNUNET_SYSERR : GNUNET_OK;
#else
return fdatasync (h->fd) == -1 ? GNUNET_SYSERR : GNUNET_OK;
diff --git a/src/util/gnunet-service-resolver.c b/src/util/gnunet-service-resolver.c
index c82a18ab8..357453da7 100644
--- a/src/util/gnunet-service-resolver.c
+++ b/src/util/gnunet-service-resolver.c
@@ -1362,7 +1362,7 @@ GNUNET_SERVICE_MAIN (
GNUNET_MQ_handler_end ());
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
diff --git a/src/util/network.c b/src/util/network.c
index 2b407d97c..52ae3d2c7 100644
--- a/src/util/network.c
+++ b/src/util/network.c
@@ -962,7 +962,7 @@ GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc)
{
int ret = 0;
-#if LINUX
+#if __linux__
int value = 0;
if (0 !=
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
index 7aa4d1254..846ceeeec 100644
--- a/src/util/os_installation.c
+++ b/src/util/os_installation.c
@@ -134,7 +134,7 @@ GNUNET_OS_init (const struct GNUNET_OS_ProjectData *pd)
}
-#if LINUX
+#if __linux__
/**
* Try to determine path by reading /proc/PID/exe
*
@@ -383,7 +383,7 @@ os_get_gnunet_path ()
if (NULL != (ret = get_path_from_GNUNET_PREFIX ()))
return ret;
-#if LINUX
+#if __linux__
if (NULL != (ret = get_path_from_proc_maps ()))
return ret;
/* try path *first*, before /proc/exe, as /proc/exe can be wrong */
@@ -421,7 +421,7 @@ os_get_exec_path ()
{
char *ret = NULL;
-#if LINUX
+#if __linux__
if (NULL != (ret = get_path_from_proc_exe ()))
return ret;
#endif
diff --git a/src/util/test_bio.c b/src/util/test_bio.c
index 8ff93c168..13ae1cf56 100644
--- a/src/util/test_bio.c
+++ b/src/util/test_bio.c
@@ -200,7 +200,7 @@ test_bigmeta_rw ()
static int
test_directory_r ()
{
-#if LINUX
+#if __linux__
char *msg;
char readResult[200];
struct GNUNET_BIO_ReadHandle *fileR;
@@ -244,7 +244,7 @@ test_nullfile_rw ()
static int
test_fullfile_rw ()
{
-#ifdef LINUX
+#ifdef __linux__
/* /dev/full only seems to exist on Linux */
char *msg;
int64_t testNum;