aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ats-tool/gnunet-ats.c10
-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
7 files changed, 44 insertions, 12 deletions
diff --git a/src/ats-tool/gnunet-ats.c b/src/ats-tool/gnunet-ats.c
index 2d19df7374..46244d4b0d 100644
--- a/src/ats-tool/gnunet-ats.c
+++ b/src/ats-tool/gnunet-ats.c
@@ -285,11 +285,11 @@ end (void *cls,
addresses = NULL;
if (0 < pending)
- FPRINTF (stderr,
+ FPRINTF (stdout,
_("%u address resolutions had a timeout\n"),
pending);
if (opt_list_used || opt_list_all)
- FPRINTF (stderr,
+ FPRINTF (stdout,
_("ATS returned stat_results for %u addresses\n"),
stat_results);
ret = 0;
@@ -362,7 +362,7 @@ transport_addr_to_str_cb (void *cls,
return;
}
- FPRINTF (stderr,
+ FPRINTF (stdout,
_("Peer `%s' plugin `%s', address `%s', `%s' bw out: %u Bytes/s, bw in %u Bytes/s, %s\n"),
GNUNET_i2s (&pr->address->peer),
pr->address->transport_name,
@@ -479,7 +479,7 @@ ats_perf_mon_cb (void *cls,
GNUNET_CONTAINER_multipeermap_remove (addresses,
&address->peer,
actx.res));
- FPRINTF (stderr,
+ FPRINTF (stdout,
_("Removed address of peer `%s' with plugin `%s'\n"),
GNUNET_i2s (&address->peer),
actx.res->address->transport_name);
@@ -672,7 +672,7 @@ print_quotas (const struct GNUNET_CONFIGURATION_Handle *cfg)
}
GNUNET_free(entry_in);
- FPRINTF (stderr,
+ FPRINTF (stdout,
_("Quota for network `%11s' (in/out): %10s / %10s\n"),
GNUNET_ATS_print_network_type (c),
quota_in_str,
diff --git a/src/util/configuration_loader.c b/src/util/configuration_loader.c
index 0b7f2865d1..c0546a2112 100644
--- a/src/util/configuration_loader.c
+++ b/src/util/configuration_loader.c
@@ -24,6 +24,12 @@
* @author Christian Grothoff
*/
+#include "platform.h"
+#include "gnunet_util_lib.h"
+
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
/**
* Load configuration (starts with defaults, then loads
* system-specific configuration).
@@ -45,8 +51,10 @@ GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg,
baseconfig = NULL;
GNUNET_asprintf (&baseconfig, "%s%s", ipath, "config.d");
GNUNET_free (ipath);
+
if (GNUNET_SYSERR ==
- GNUNET_DISK_directory_scan (baseconfig, &parse_configuration_file, cfg))
+ GNUNET_CONFIGURATION_load_from (cfg,
+ baseconfig))
{
GNUNET_free (baseconfig);
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 32e1acee3a..67f1dea24e 100644
--- a/src/util/crypto_ecc_setup.c
+++ b/src/util/crypto_ecc_setup.c
@@ -27,6 +27,19 @@
#include <gcrypt.h>
#include "gnunet_util_lib.h"
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", syscall)
+
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
+
+/**
+ * Log an error message at log-level 'level' that indicates
+ * a failure of the command 'cmd' with the message given
+ * by gcry_strerror(rc).
+ */
+#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)
+
/**
* 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 9456e343bf..e9f25bf842 100644
--- a/src/util/crypto_hash.c
+++ b/src/util/crypto_hash.c
@@ -18,13 +18,11 @@
Boston, MA 02111-1307, USA.
*/
-
/**
* @file util/crypto_hash.c
* @brief SHA-512 #GNUNET_CRYPTO_hash() related functions
* @author Christian Grothoff
*/
-
#include "platform.h"
#include "gnunet_util_lib.h"
#include <gcrypt.h>
diff --git a/src/util/crypto_hash_file.c b/src/util/crypto_hash_file.c
index 2d15fac36e..f2b53008ea 100644
--- a/src/util/crypto_hash_file.c
+++ b/src/util/crypto_hash_file.c
@@ -18,12 +18,18 @@
Boston, MA 02111-1307, USA.
*/
-
/**
* @file util/crypto_hash_file.c
* @brief incremental hashing of files
* @author Christian Grothoff
*/
+#include "platform.h"
+#include "gnunet_util_lib.h"
+#include <gcrypt.h>
+
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
/**
diff --git a/src/util/disk.c b/src/util/disk.c
index 81413265e7..a56966d04f 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -17,14 +17,12 @@
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
-
/**
* @file util/disk.c
* @brief disk IO convenience methods
* @author Christian Grothoff
* @author Nils Durner
*/
-
#include "platform.h"
#include "gnunet_util_lib.h"
#include "disk.h"
@@ -609,7 +607,7 @@ GNUNET_DISK_mktemp (const char *t)
* with the same name).
*
* @param fil filename to test
- * @param is_readable GNUNET_YES to additionally check if @a fil is readable;
+ * @param is_readable #GNUNET_YES to additionally check if @a fil is readable;
* #GNUNET_NO to disable this check
* @return #GNUNET_YES if yes, #GNUNET_NO if not; #GNUNET_SYSERR if it
* does not exist or stat'ed
diff --git a/src/util/disk_iterator.c b/src/util/disk_iterator.c
index 118823df62..99cd1e9de4 100644
--- a/src/util/disk_iterator.c
+++ b/src/util/disk_iterator.c
@@ -23,6 +23,15 @@
* @author Christian Grothoff
* @author Nils Durner
*/
+#include "platform.h"
+#include "gnunet_util_lib.h"
+#include "disk.h"
+
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", syscall)
+
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
/**