diff options
Diffstat (limited to 'src/transport/gnunet-helper-transport-wlan-dummy.c')
-rw-r--r-- | src/transport/gnunet-helper-transport-wlan-dummy.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/transport/gnunet-helper-transport-wlan-dummy.c b/src/transport/gnunet-helper-transport-wlan-dummy.c index dbd9014cb..c7ed1b903 100644 --- a/src/transport/gnunet-helper-transport-wlan-dummy.c +++ b/src/transport/gnunet-helper-transport-wlan-dummy.c | |||
@@ -140,13 +140,13 @@ stdin_send (void *cls, | |||
140 | if ( (GNUNET_MESSAGE_TYPE_WLAN_DATA_TO_HELPER != ntohs (hdr->type)) || | 140 | if ( (GNUNET_MESSAGE_TYPE_WLAN_DATA_TO_HELPER != ntohs (hdr->type)) || |
141 | (sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage) > sendsize) ) | 141 | (sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage) > sendsize) ) |
142 | { | 142 | { |
143 | FPRINTF (stderr, "%s", "Received malformed message\n"); | 143 | fprintf (stderr, "%s", "Received malformed message\n"); |
144 | exit (1); | 144 | exit (1); |
145 | } | 145 | } |
146 | payload_size = sendsize - sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage); | 146 | payload_size = sendsize - sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage); |
147 | if ((payload_size + sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage) + write_pout->size) > MAXLINE * 2) | 147 | if ((payload_size + sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage) + write_pout->size) > MAXLINE * 2) |
148 | { | 148 | { |
149 | FPRINTF (stderr, "%s", "Packet too big for buffer\n"); | 149 | fprintf (stderr, "%s", "Packet too big for buffer\n"); |
150 | exit (1); | 150 | exit (1); |
151 | } | 151 | } |
152 | memset (&newheader, 0, sizeof (newheader)); | 152 | memset (&newheader, 0, sizeof (newheader)); |
@@ -184,7 +184,7 @@ file_in_send (void *cls, | |||
184 | sendsize = ntohs (hdr->size); | 184 | sendsize = ntohs (hdr->size); |
185 | if ((sendsize + write_std->size) > MAXLINE * 2) | 185 | if ((sendsize + write_std->size) > MAXLINE * 2) |
186 | { | 186 | { |
187 | FPRINTF (stderr, "%s", "Packet too big for buffer\n"); | 187 | fprintf (stderr, "%s", "Packet too big for buffer\n"); |
188 | exit (1); | 188 | exit (1); |
189 | } | 189 | } |
190 | GNUNET_memcpy (write_std->buf + write_std->size, hdr, sendsize); | 190 | GNUNET_memcpy (write_std->buf + write_std->size, hdr, sendsize); |
@@ -227,7 +227,7 @@ main (int argc, char *argv[]) | |||
227 | if ( (2 != argc) || | 227 | if ( (2 != argc) || |
228 | ((0 != strcmp (argv[1], "1")) && (0 != strcmp (argv[1], "2"))) ) | 228 | ((0 != strcmp (argv[1], "1")) && (0 != strcmp (argv[1], "2"))) ) |
229 | { | 229 | { |
230 | FPRINTF (stderr, | 230 | fprintf (stderr, |
231 | "%s", | 231 | "%s", |
232 | "This program must be started with the operating mode (1 or 2) as the only argument.\n"); | 232 | "This program must be started with the operating mode (1 or 2) as the only argument.\n"); |
233 | return 1; | 233 | return 1; |
@@ -238,7 +238,7 @@ main (int argc, char *argv[]) | |||
238 | if ( (GNUNET_OK != GNUNET_DISK_directory_create_for_file (FIFO_FILE1)) || | 238 | if ( (GNUNET_OK != GNUNET_DISK_directory_create_for_file (FIFO_FILE1)) || |
239 | (GNUNET_OK != GNUNET_DISK_directory_create_for_file (FIFO_FILE2)) ) | 239 | (GNUNET_OK != GNUNET_DISK_directory_create_for_file (FIFO_FILE2)) ) |
240 | { | 240 | { |
241 | FPRINTF (stderr, | 241 | fprintf (stderr, |
242 | "Failed to create directory for file `%s'\n", | 242 | "Failed to create directory for file `%s'\n", |
243 | FIFO_FILE1); | 243 | FIFO_FILE1); |
244 | return 1; | 244 | return 1; |
@@ -249,7 +249,7 @@ main (int argc, char *argv[]) | |||
249 | { | 249 | { |
250 | erg = mkfifo (FIFO_FILE1, 0666); | 250 | erg = mkfifo (FIFO_FILE1, 0666); |
251 | if ( (0 != erg) && (EEXIST != errno) ) | 251 | if ( (0 != erg) && (EEXIST != errno) ) |
252 | FPRINTF (stderr, "Error in mkfifo(%s): %s\n", FIFO_FILE1, | 252 | fprintf (stderr, "Error in mkfifo(%s): %s\n", FIFO_FILE1, |
253 | strerror (errno)); | 253 | strerror (errno)); |
254 | } | 254 | } |
255 | } | 255 | } |
@@ -259,7 +259,7 @@ main (int argc, char *argv[]) | |||
259 | { | 259 | { |
260 | GNUNET_break (0 == (erg = mkfifo (FIFO_FILE2, 0666))); | 260 | GNUNET_break (0 == (erg = mkfifo (FIFO_FILE2, 0666))); |
261 | if ( (0 != erg) && (EEXIST != errno) ) | 261 | if ( (0 != erg) && (EEXIST != errno) ) |
262 | FPRINTF (stderr, | 262 | fprintf (stderr, |
263 | "Error in mkfifo(%s): %s\n", | 263 | "Error in mkfifo(%s): %s\n", |
264 | FIFO_FILE2, | 264 | FIFO_FILE2, |
265 | strerror (errno)); | 265 | strerror (errno)); |
@@ -272,7 +272,7 @@ main (int argc, char *argv[]) | |||
272 | fpin = fopen (FIFO_FILE1, "r"); | 272 | fpin = fopen (FIFO_FILE1, "r"); |
273 | if (NULL == fpin) | 273 | if (NULL == fpin) |
274 | { | 274 | { |
275 | FPRINTF (stderr, | 275 | fprintf (stderr, |
276 | "fopen of read FIFO_FILE1 failed: %s\n", | 276 | "fopen of read FIFO_FILE1 failed: %s\n", |
277 | STRERROR (errno)); | 277 | STRERROR (errno)); |
278 | goto end; | 278 | goto end; |
@@ -284,7 +284,7 @@ main (int argc, char *argv[]) | |||
284 | } | 284 | } |
285 | if (NULL == fpout) | 285 | if (NULL == fpout) |
286 | { | 286 | { |
287 | FPRINTF (stderr, | 287 | fprintf (stderr, |
288 | "fopen of write FIFO_FILE2 failed: %s\n", | 288 | "fopen of write FIFO_FILE2 failed: %s\n", |
289 | STRERROR (errno)); | 289 | STRERROR (errno)); |
290 | goto end; | 290 | goto end; |
@@ -300,7 +300,7 @@ main (int argc, char *argv[]) | |||
300 | } | 300 | } |
301 | if (NULL == fpout) | 301 | if (NULL == fpout) |
302 | { | 302 | { |
303 | FPRINTF (stderr, | 303 | fprintf (stderr, |
304 | "fopen of write FIFO_FILE1 failed: %s\n", | 304 | "fopen of write FIFO_FILE1 failed: %s\n", |
305 | STRERROR (errno)); | 305 | STRERROR (errno)); |
306 | goto end; | 306 | goto end; |
@@ -308,7 +308,7 @@ main (int argc, char *argv[]) | |||
308 | fpin = fopen (FIFO_FILE2, "r"); | 308 | fpin = fopen (FIFO_FILE2, "r"); |
309 | if (NULL == fpin) | 309 | if (NULL == fpin) |
310 | { | 310 | { |
311 | FPRINTF (stderr, | 311 | fprintf (stderr, |
312 | "fopen of read FIFO_FILE2 failed: %s\n", | 312 | "fopen of read FIFO_FILE2 failed: %s\n", |
313 | STRERROR (errno)); | 313 | STRERROR (errno)); |
314 | goto end; | 314 | goto end; |
@@ -319,7 +319,7 @@ main (int argc, char *argv[]) | |||
319 | GNUNET_assert (fpin >= 0); | 319 | GNUNET_assert (fpin >= 0); |
320 | if (fdpin >= FD_SETSIZE) | 320 | if (fdpin >= FD_SETSIZE) |
321 | { | 321 | { |
322 | FPRINTF (stderr, | 322 | fprintf (stderr, |
323 | "File fdpin number too large (%d > %u)\n", | 323 | "File fdpin number too large (%d > %u)\n", |
324 | fdpin, | 324 | fdpin, |
325 | (unsigned int) FD_SETSIZE); | 325 | (unsigned int) FD_SETSIZE); |
@@ -331,7 +331,7 @@ main (int argc, char *argv[]) | |||
331 | 331 | ||
332 | if (fdpout >= FD_SETSIZE) | 332 | if (fdpout >= FD_SETSIZE) |
333 | { | 333 | { |
334 | FPRINTF (stderr, | 334 | fprintf (stderr, |
335 | "File fdpout number too large (%d > %u)\n", | 335 | "File fdpout number too large (%d > %u)\n", |
336 | fdpout, | 336 | fdpout, |
337 | (unsigned int) FD_SETSIZE); | 337 | (unsigned int) FD_SETSIZE); |
@@ -395,7 +395,7 @@ main (int argc, char *argv[]) | |||
395 | continue; | 395 | continue; |
396 | if (0 > retval) | 396 | if (0 > retval) |
397 | { | 397 | { |
398 | FPRINTF (stderr, "select failed: %s\n", STRERROR (errno)); | 398 | fprintf (stderr, "select failed: %s\n", STRERROR (errno)); |
399 | closeprog = 1; | 399 | closeprog = 1; |
400 | break; | 400 | break; |
401 | } | 401 | } |
@@ -408,7 +408,7 @@ main (int argc, char *argv[]) | |||
408 | if (0 > ret) | 408 | if (0 > ret) |
409 | { | 409 | { |
410 | closeprog = 1; | 410 | closeprog = 1; |
411 | FPRINTF (stderr, "Write ERROR to STDOUT_FILENO: %s\n", | 411 | fprintf (stderr, "Write ERROR to STDOUT_FILENO: %s\n", |
412 | STRERROR (errno)); | 412 | STRERROR (errno)); |
413 | break; | 413 | break; |
414 | } | 414 | } |
@@ -433,7 +433,7 @@ main (int argc, char *argv[]) | |||
433 | if (0 > ret) | 433 | if (0 > ret) |
434 | { | 434 | { |
435 | closeprog = 1; | 435 | closeprog = 1; |
436 | FPRINTF (stderr, "Write ERROR to fdpout failed: %s\n", STRERROR (errno)); | 436 | fprintf (stderr, "Write ERROR to fdpout failed: %s\n", STRERROR (errno)); |
437 | } | 437 | } |
438 | else | 438 | else |
439 | { | 439 | { |
@@ -454,7 +454,7 @@ main (int argc, char *argv[]) | |||
454 | if (0 > readsize) | 454 | if (0 > readsize) |
455 | { | 455 | { |
456 | closeprog = 1; | 456 | closeprog = 1; |
457 | FPRINTF (stderr, "Error reading from STDIN_FILENO: %s\n", | 457 | fprintf (stderr, "Error reading from STDIN_FILENO: %s\n", |
458 | STRERROR (errno)); | 458 | STRERROR (errno)); |
459 | } | 459 | } |
460 | else if (0 < readsize) | 460 | else if (0 < readsize) |
@@ -477,7 +477,7 @@ main (int argc, char *argv[]) | |||
477 | if (0 > readsize) | 477 | if (0 > readsize) |
478 | { | 478 | { |
479 | closeprog = 1; | 479 | closeprog = 1; |
480 | FPRINTF (stderr, "Error reading from fdpin: %s\n", STRERROR (errno)); | 480 | fprintf (stderr, "Error reading from fdpin: %s\n", STRERROR (errno)); |
481 | break; | 481 | break; |
482 | } | 482 | } |
483 | else if (0 < readsize) | 483 | else if (0 < readsize) |