aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_udp_broadcasting.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-12-05 15:05:11 +0000
committerChristian Grothoff <christian@grothoff.org>2013-12-05 15:05:11 +0000
commit1b643a5a7622237e5c327f22d0da8d830bb7e317 (patch)
tree3282fc11082730b70ca78be489117ceeee896a40 /src/transport/plugin_transport_udp_broadcasting.c
parentfe914a68d9d38e0c763ff55a446bcb049d0a2263 (diff)
downloadgnunet-1b643a5a7622237e5c327f22d0da8d830bb7e317.tar.gz
gnunet-1b643a5a7622237e5c327f22d0da8d830bb7e317.zip
only try to open /dev/power if it actually exists
Diffstat (limited to 'src/transport/plugin_transport_udp_broadcasting.c')
-rw-r--r--src/transport/plugin_transport_udp_broadcasting.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c
index a289118f1..0503e413a 100644
--- a/src/transport/plugin_transport_udp_broadcasting.c
+++ b/src/transport/plugin_transport_udp_broadcasting.c
@@ -517,10 +517,13 @@ iface_proc (void *cls,
517 GNUNET_asprintf (&filename, 517 GNUNET_asprintf (&filename,
518 "/dev/power/%s", 518 "/dev/power/%s",
519 name); 519 name);
520 ba->cryogenic_fd = 520 if (0 == ACCESS (name, R_OK))
521 {
522 ba->cryogenic_fd =
521 GNUNET_DISK_file_open (filename, 523 GNUNET_DISK_file_open (filename,
522 GNUNET_DISK_OPEN_WRITE, 524 GNUNET_DISK_OPEN_WRITE,
523 GNUNET_DISK_PERM_NONE); 525 GNUNET_DISK_PERM_NONE);
526 }
524 GNUNET_free (filename); 527 GNUNET_free (filename);
525#endif 528#endif
526 ba->broadcast_task = 529 ba->broadcast_task =
@@ -569,10 +572,13 @@ iface_proc (void *cls,
569 GNUNET_asprintf (&filename, 572 GNUNET_asprintf (&filename,
570 "/dev/power/%s", 573 "/dev/power/%s",
571 name); 574 name);
572 ba->cryogenic_fd = 575 if (0 == ACCESS (name, R_OK))
576 {
577 ba->cryogenic_fd =
573 GNUNET_DISK_file_open (filename, 578 GNUNET_DISK_file_open (filename,
574 GNUNET_DISK_OPEN_WRITE, 579 GNUNET_DISK_OPEN_WRITE,
575 GNUNET_DISK_PERM_NONE); 580 GNUNET_DISK_PERM_NONE);
581 }
576 GNUNET_free (filename); 582 GNUNET_free (filename);
577#endif 583#endif
578 ba->broadcast_task = 584 ba->broadcast_task =