summaryrefslogtreecommitdiff
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)
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,
GNUNET_asprintf (&filename,
"/dev/power/%s",
name);
- ba->cryogenic_fd =
+ if (0 == ACCESS (name, R_OK))
+ {
+ ba->cryogenic_fd =
GNUNET_DISK_file_open (filename,
- GNUNET_DISK_OPEN_WRITE,
- GNUNET_DISK_PERM_NONE);
+ GNUNET_DISK_OPEN_WRITE,
+ GNUNET_DISK_PERM_NONE);
+ }
GNUNET_free (filename);
#endif
ba->broadcast_task =
@@ -569,10 +572,13 @@ iface_proc (void *cls,
GNUNET_asprintf (&filename,
"/dev/power/%s",
name);
- ba->cryogenic_fd =
+ if (0 == ACCESS (name, R_OK))
+ {
+ ba->cryogenic_fd =
GNUNET_DISK_file_open (filename,
- GNUNET_DISK_OPEN_WRITE,
- GNUNET_DISK_PERM_NONE);
+ GNUNET_DISK_OPEN_WRITE,
+ GNUNET_DISK_PERM_NONE);
+ }
GNUNET_free (filename);
#endif
ba->broadcast_task =