From: Christian Grothoff Date: Thu, 5 Dec 2013 15:05:11 +0000 (+0000) Subject: only try to open /dev/power if it actually exists X-Git-Tag: initial-import-from-subversion-38251~5762 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1b643a5a7622237e5c327f22d0da8d830bb7e317;p=oweals%2Fgnunet.git only try to open /dev/power if it actually exists --- 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 =