aboutsummaryrefslogtreecommitdiff
path: root/src/rps/gnunet-rps-profiler.c
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2018-09-06 03:17:01 +0200
committerJulius Bünger <buenger@mytum.de>2018-09-06 03:20:55 +0200
commitc78aa8d4b4ec473694973aae21928be5ecc2b903 (patch)
tree275cafa6681c7f54e0cdb75a40dd00cf5b56e361 /src/rps/gnunet-rps-profiler.c
parent2b1b981479da64d13d3ae8389964b029e9f268b6 (diff)
downloadgnunet-c78aa8d4b4ec473694973aae21928be5ecc2b903.tar.gz
gnunet-c78aa8d4b4ec473694973aae21928be5ecc2b903.zip
Fix non-compiling code by proper pre-compiler usage
Diffstat (limited to 'src/rps/gnunet-rps-profiler.c')
-rw-r--r--src/rps/gnunet-rps-profiler.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rps/gnunet-rps-profiler.c b/src/rps/gnunet-rps-profiler.c
index 073d26ffd..d2640225a 100644
--- a/src/rps/gnunet-rps-profiler.c
+++ b/src/rps/gnunet-rps-profiler.c
@@ -1821,6 +1821,7 @@ profiler_reply_handle (void *cls,
1821 tofile (file_name_dh, 1821 tofile (file_name_dh,
1822 "%" PRIu32 "\n", 1822 "%" PRIu32 "\n",
1823 (uint32_t) rcv_rps_peer->index); 1823 (uint32_t) rcv_rps_peer->index);
1824#ifdef TO_FILE
1824 to_file_raw (file_name_dhr, 1825 to_file_raw (file_name_dhr,
1825 (char *) &rcv_rps_peer->index, 1826 (char *) &rcv_rps_peer->index,
1826 sizeof (uint32_t)); 1827 sizeof (uint32_t));
@@ -1828,6 +1829,7 @@ profiler_reply_handle (void *cls,
1828 (char *) &rcv_rps_peer->index, 1829 (char *) &rcv_rps_peer->index,
1829 sizeof (uint32_t), 1830 sizeof (uint32_t),
1830 bits_needed); 1831 bits_needed);
1832#endif /* TO_FILE */
1831 } 1833 }
1832 default_reply_handle (cls, n, recv_peers); 1834 default_reply_handle (cls, n, recv_peers);
1833} 1835}
@@ -1871,7 +1873,7 @@ profiler_cb (struct RPSPeer *rps_peer)
1871 * #GNUNET_NO to stop iteration with no error, 1873 * #GNUNET_NO to stop iteration with no error,
1872 * #GNUNET_SYSERR to abort iteration with error! 1874 * #GNUNET_SYSERR to abort iteration with error!
1873 */ 1875 */
1874int 1876static int
1875file_name_cb (void *cls, const char *filename) 1877file_name_cb (void *cls, const char *filename)
1876{ 1878{
1877 if (NULL != strstr (filename, "sampler_el")) 1879 if (NULL != strstr (filename, "sampler_el"))
@@ -1903,14 +1905,16 @@ file_name_cb (void *cls, const char *filename)
1903 * 1905 *
1904 * Compute all perfect samples. 1906 * Compute all perfect samples.
1905 */ 1907 */
1906int 1908static int
1907profiler_eval (void) 1909profiler_eval (void)
1908{ 1910{
1911#ifdef TO_FILE
1909 /* Compute perfect sample for each sampler element */ 1912 /* Compute perfect sample for each sampler element */
1910 if (-1 == GNUNET_DISK_directory_scan ("/tmp/rps/", file_name_cb, NULL)) 1913 if (-1 == GNUNET_DISK_directory_scan ("/tmp/rps/", file_name_cb, NULL))
1911 { 1914 {
1912 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Scan of directory failed\n"); 1915 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Scan of directory failed\n");
1913 } 1916 }
1917#endif /* TO_FILE */
1914 1918
1915 return evaluate (); 1919 return evaluate ();
1916} 1920}