[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] branch master updated: more verbose logging
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] branch master updated: more verbose logging |
Date: |
Thu, 10 May 2018 13:37:03 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new 5351d6b08 more verbose logging
5351d6b08 is described below
commit 5351d6b088a895b5c21577ec540f139f2d6d2467
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu May 10 13:37:02 2018 +0200
more verbose logging
---
src/transport/test_plugin_transport.c | 33 +++++++++++++++++++++------------
src/util/disk.c | 24 +++++++++++++++++++++---
2 files changed, 42 insertions(+), 15 deletions(-)
diff --git a/src/transport/test_plugin_transport.c
b/src/transport/test_plugin_transport.c
index acb3911f0..d80a13410 100644
--- a/src/transport/test_plugin_transport.c
+++ b/src/transport/test_plugin_transport.c
@@ -566,8 +566,10 @@ handle_helper_message (void *cls,
* @param c configuration to use
*/
static void
-run (void *cls, char * const *args, const char *cfgfile,
- const struct GNUNET_CONFIGURATION_Handle *c)
+run (void *cls,
+ char * const *args,
+ const char *cfgfile,
+ const struct GNUNET_CONFIGURATION_Handle *c)
{
char * const *argv = cls;
unsigned long long tneigh;
@@ -575,8 +577,9 @@ run (void *cls, char * const *args, const char *cfgfile,
char *plugin;
char *sep;
- timeout_endbadly = GNUNET_SCHEDULER_add_delayed (TIMEOUT, end_badly, &ok);
-
+ timeout_endbadly = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
+ &end_badly,
+ &ok);
cfg = c;
/* parse configuration */
if ((GNUNET_OK
@@ -594,7 +597,7 @@ run (void *cls, char * const *args, const char *cfgfile,
if (NULL == (stats = GNUNET_STATISTICS_create ("transport", cfg)))
{
GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
- "Could not create statistics. Exiting.\n");
+ "Could not create statistics. Exiting.\n");
GNUNET_free(keyfile);
end_badly_now ();
return;
@@ -602,27 +605,33 @@ run (void *cls, char * const *args, const char *cfgfile,
if (GNUNET_OK != GNUNET_DISK_file_test (HOSTKEY_FILE))
{
- GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Hostkey `%s' missing. Exiting.\n",
- HOSTKEY_FILE);
+ GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
+ "Hostkey `%s' missing. Exiting.\n",
+ HOSTKEY_FILE);
GNUNET_free(keyfile);
end_badly_now ();
return;
}
- if (GNUNET_OK != GNUNET_DISK_directory_create_for_file (keyfile))
+ if (GNUNET_OK !=
+ GNUNET_DISK_directory_create_for_file (keyfile))
{
GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
- "Could not create a directory for hostkey `%s'. Exiting.\n", keyfile);
+ "Could not create a directory for hostkey `%s'. Exiting.\n",
+ keyfile);
GNUNET_free(keyfile);
end_badly_now ();
return;
}
- if (GNUNET_OK != GNUNET_DISK_file_copy (HOSTKEY_FILE, keyfile))
+ if (GNUNET_OK !=
+ GNUNET_DISK_file_copy (HOSTKEY_FILE,
+ keyfile))
{
GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
- "Could not copy hostkey `%s' to destination `%s'. Exiting.\n",
- HOSTKEY_FILE, keyfile);
+ "Could not copy hostkey `%s' to destination `%s'. Exiting.\n",
+ HOSTKEY_FILE,
+ keyfile);
GNUNET_free(keyfile);
end_badly_now ();
return;
diff --git a/src/util/disk.c b/src/util/disk.c
index 37d689576..9e542a91c 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -1401,13 +1401,28 @@ GNUNET_DISK_file_copy (const char *src,
struct GNUNET_DISK_FileHandle *in;
struct GNUNET_DISK_FileHandle *out;
- if (GNUNET_OK != GNUNET_DISK_file_size (src, &size, GNUNET_YES, GNUNET_YES))
+ if (GNUNET_OK !=
+ GNUNET_DISK_file_size (src,
+ &size,
+ GNUNET_YES,
+ GNUNET_YES))
+ {
+ GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
+ "stat",
+ src);
return GNUNET_SYSERR;
+ }
pos = 0;
- in = GNUNET_DISK_file_open (src, GNUNET_DISK_OPEN_READ,
+ in = GNUNET_DISK_file_open (src,
+ GNUNET_DISK_OPEN_READ,
GNUNET_DISK_PERM_NONE);
- if (!in)
+ if (! in)
+ {
+ GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
+ "open",
+ src);
return GNUNET_SYSERR;
+ }
out =
GNUNET_DISK_file_open (dst,
GNUNET_DISK_OPEN_WRITE | GNUNET_DISK_OPEN_CREATE |
@@ -1418,6 +1433,9 @@ GNUNET_DISK_file_copy (const char *src,
GNUNET_DISK_PERM_GROUP_WRITE);
if (!out)
{
+ GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
+ "open",
+ dst);
GNUNET_DISK_file_close (in);
return GNUNET_SYSERR;
}
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [gnunet] branch master updated: more verbose logging,
gnunet <=