aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/test_testbed_logger_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testbed/test_testbed_logger_api.c')
-rw-r--r--src/testbed/test_testbed_logger_api.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/testbed/test_testbed_logger_api.c b/src/testbed/test_testbed_logger_api.c
index 30740c94d..f140dfbad 100644
--- a/src/testbed/test_testbed_logger_api.c
+++ b/src/testbed/test_testbed_logger_api.c
@@ -113,39 +113,39 @@ do_abort (void *cls)
113 * 113 *
114 * @param cls closure 114 * @param cls closure
115 * @param filename complete filename (absolute path) 115 * @param filename complete filename (absolute path)
116 * @return #GNUNET_OK to continue to iterate,
117 * #GNUNET_NO to stop iteration with no error,
118 * #GNUNET_SYSERR to abort iteration with error!
116 */ 119 */
117static void 120static int
118iterator_cb (void *cls, 121iterator_cb (void *cls,
119 const char *filename) 122 const char *filename)
120{ 123{
121 const char *fn; 124 const char *fn;
122 size_t len; 125 size_t len;
123 uint64_t fs; 126 uint64_t fs;
124 int cancel;
125 127
126 cancel = GNUNET_NO;
127 if (NULL == filename)
128 return;
129 len = strlen (filename); 128 len = strlen (filename);
130 if (len < 5) /* log file: `pid'.dat */ 129 if (len < 5) /* log file: `pid'.dat */
131 return; 130 return GNUNET_OK;
131
132 fn = filename + len; 132 fn = filename + len;
133 if (0 != strcasecmp (".dat", fn - 4)) 133 if (0 != strcasecmp (".dat", fn - 4))
134 return; 134 return GNUNET_OK;
135 if (GNUNET_OK != GNUNET_DISK_file_size (filename, &fs, 135 if (GNUNET_OK !=
136 GNUNET_NO, GNUNET_YES)) 136 GNUNET_DISK_file_size (filename, &fs,
137 return; 137 GNUNET_NO, GNUNET_YES))
138 return GNUNET_SYSERR;
138 if ((BSIZE * 2) != fs) /* The file size should be equal to what we 139 if ((BSIZE * 2) != fs) /* The file size should be equal to what we
139 have written */ 140 have written */
140 return; 141 return GNUNET_SYSERR;
141 cancel = GNUNET_YES; 142 return GNUNET_OK;
142 result = GNUNET_OK;
143} 143}
144 144
145 145
146/** 146/**
147 * Functions of this type are called to notify a successful transmission of the 147 * Functions of this type are called to notify a successful
148 * message to the logger service 148 * transmission of the message to the logger service
149 * 149 *
150 * @param cls the closure given to GNUNET_TESTBED_LOGGER_send() 150 * @param cls the closure given to GNUNET_TESTBED_LOGGER_send()
151 * @param size the amount of data sent 151 * @param size the amount of data sent