aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-05-28 09:58:58 +0000
committerChristian Grothoff <christian@grothoff.org>2015-05-28 09:58:58 +0000
commitfc1b9d4caffabba3411a27f62f9ea309a2cf8edc (patch)
tree1531a48624abbf478a27a1780e243c1059a7a938 /src/util
parentb1294ac8f7a3cf9d53334485b7ff2d97d3fb4ab7 (diff)
downloadgnunet-fc1b9d4caffabba3411a27f62f9ea309a2cf8edc.tar.gz
gnunet-fc1b9d4caffabba3411a27f62f9ea309a2cf8edc.zip
-fix ftbfs
Diffstat (limited to 'src/util')
-rw-r--r--src/util/configuration_loader.c10
-rw-r--r--src/util/crypto_ecc_setup.c13
-rw-r--r--src/util/crypto_hash.c2
-rw-r--r--src/util/crypto_hash_file.c8
-rw-r--r--src/util/disk.c4
-rw-r--r--src/util/disk_iterator.c9
6 files changed, 39 insertions, 7 deletions
diff --git a/src/util/configuration_loader.c b/src/util/configuration_loader.c
index 0b7f2865d..c0546a211 100644
--- a/src/util/configuration_loader.c
+++ b/src/util/configuration_loader.c
@@ -24,6 +24,12 @@
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26 26
27#include "platform.h"
28#include "gnunet_util_lib.h"
29
30#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
31
32#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
27/** 33/**
28 * Load configuration (starts with defaults, then loads 34 * Load configuration (starts with defaults, then loads
29 * system-specific configuration). 35 * system-specific configuration).
@@ -45,8 +51,10 @@ GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg,
45 baseconfig = NULL; 51 baseconfig = NULL;
46 GNUNET_asprintf (&baseconfig, "%s%s", ipath, "config.d"); 52 GNUNET_asprintf (&baseconfig, "%s%s", ipath, "config.d");
47 GNUNET_free (ipath); 53 GNUNET_free (ipath);
54
48 if (GNUNET_SYSERR == 55 if (GNUNET_SYSERR ==
49 GNUNET_DISK_directory_scan (baseconfig, &parse_configuration_file, cfg)) 56 GNUNET_CONFIGURATION_load_from (cfg,
57 baseconfig))
50 { 58 {
51 GNUNET_free (baseconfig); 59 GNUNET_free (baseconfig);
52 return GNUNET_SYSERR; /* no configuration at all found */ 60 return GNUNET_SYSERR; /* no configuration at all found */
diff --git a/src/util/crypto_ecc_setup.c b/src/util/crypto_ecc_setup.c
index 32e1acee3..67f1dea24 100644
--- a/src/util/crypto_ecc_setup.c
+++ b/src/util/crypto_ecc_setup.c
@@ -27,6 +27,19 @@
27#include <gcrypt.h> 27#include <gcrypt.h>
28#include "gnunet_util_lib.h" 28#include "gnunet_util_lib.h"
29 29
30#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
31
32#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", syscall)
33
34#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
35
36/**
37 * Log an error message at log-level 'level' that indicates
38 * a failure of the command 'cmd' with the message given
39 * by gcry_strerror(rc).
40 */
41#define LOG_GCRY(level, cmd, rc) do { LOG(level, _("`%s' failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, gcry_strerror(rc)); } while(0)
42
30 43
31/** 44/**
32 * Wait for a short time (we're trying to lock a file or want 45 * Wait for a short time (we're trying to lock a file or want
diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c
index 9456e343b..e9f25bf84 100644
--- a/src/util/crypto_hash.c
+++ b/src/util/crypto_hash.c
@@ -18,13 +18,11 @@
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19 19
20*/ 20*/
21
22/** 21/**
23 * @file util/crypto_hash.c 22 * @file util/crypto_hash.c
24 * @brief SHA-512 #GNUNET_CRYPTO_hash() related functions 23 * @brief SHA-512 #GNUNET_CRYPTO_hash() related functions
25 * @author Christian Grothoff 24 * @author Christian Grothoff
26 */ 25 */
27
28#include "platform.h" 26#include "platform.h"
29#include "gnunet_util_lib.h" 27#include "gnunet_util_lib.h"
30#include <gcrypt.h> 28#include <gcrypt.h>
diff --git a/src/util/crypto_hash_file.c b/src/util/crypto_hash_file.c
index 2d15fac36..f2b53008e 100644
--- a/src/util/crypto_hash_file.c
+++ b/src/util/crypto_hash_file.c
@@ -18,12 +18,18 @@
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19 19
20*/ 20*/
21
22/** 21/**
23 * @file util/crypto_hash_file.c 22 * @file util/crypto_hash_file.c
24 * @brief incremental hashing of files 23 * @brief incremental hashing of files
25 * @author Christian Grothoff 24 * @author Christian Grothoff
26 */ 25 */
26#include "platform.h"
27#include "gnunet_util_lib.h"
28#include <gcrypt.h>
29
30#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
31
32#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
27 33
28 34
29/** 35/**
diff --git a/src/util/disk.c b/src/util/disk.c
index 81413265e..a56966d04 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -17,14 +17,12 @@
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20
21/** 20/**
22 * @file util/disk.c 21 * @file util/disk.c
23 * @brief disk IO convenience methods 22 * @brief disk IO convenience methods
24 * @author Christian Grothoff 23 * @author Christian Grothoff
25 * @author Nils Durner 24 * @author Nils Durner
26 */ 25 */
27
28#include "platform.h" 26#include "platform.h"
29#include "gnunet_util_lib.h" 27#include "gnunet_util_lib.h"
30#include "disk.h" 28#include "disk.h"
@@ -609,7 +607,7 @@ GNUNET_DISK_mktemp (const char *t)
609 * with the same name). 607 * with the same name).
610 * 608 *
611 * @param fil filename to test 609 * @param fil filename to test
612 * @param is_readable GNUNET_YES to additionally check if @a fil is readable; 610 * @param is_readable #GNUNET_YES to additionally check if @a fil is readable;
613 * #GNUNET_NO to disable this check 611 * #GNUNET_NO to disable this check
614 * @return #GNUNET_YES if yes, #GNUNET_NO if not; #GNUNET_SYSERR if it 612 * @return #GNUNET_YES if yes, #GNUNET_NO if not; #GNUNET_SYSERR if it
615 * does not exist or stat'ed 613 * does not exist or stat'ed
diff --git a/src/util/disk_iterator.c b/src/util/disk_iterator.c
index 118823df6..99cd1e9de 100644
--- a/src/util/disk_iterator.c
+++ b/src/util/disk_iterator.c
@@ -23,6 +23,15 @@
23 * @author Christian Grothoff 23 * @author Christian Grothoff
24 * @author Nils Durner 24 * @author Nils Durner
25 */ 25 */
26#include "platform.h"
27#include "gnunet_util_lib.h"
28#include "disk.h"
29
30#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
31
32#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", syscall)
33
34#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
26 35
27 36
28/** 37/**