summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-07-18 13:39:41 +0000
committerChristian Grothoff <christian@grothoff.org>2015-07-18 13:39:41 +0000
commitad91280a3f21f030501918d5fef92f05d5c066f2 (patch)
tree4362f70e3a9729627c61545a58b17e460f67b6b5
parent957ba741a643ac853f7cd6c00f05f41cf57d8d59 (diff)
minor modifications to reduce warnings
-rw-r--r--src/transport/gnunet-helper-transport-bluetooth.c32
-rw-r--r--src/transport/gnunet-helper-transport-wlan.c29
-rw-r--r--src/transport/plugin_transport_http_server.c1
3 files changed, 37 insertions, 25 deletions
diff --git a/src/transport/gnunet-helper-transport-bluetooth.c b/src/transport/gnunet-helper-transport-bluetooth.c
index 20c27ad58..acb6d24d5 100644
--- a/src/transport/gnunet-helper-transport-bluetooth.c
+++ b/src/transport/gnunet-helper-transport-bluetooth.c
@@ -1667,24 +1667,30 @@ main (int argc, char *argv[])
int stdin_open;
struct MessageStreamTokenizer *stdin_mst;
int raw_eno, i;
- uid_t uid;
int crt_rfds = 0, rfds_list[MAX_PORTS];
int broadcast, sendsocket;
+
/* Assert privs so we can modify the firewall rules! */
- uid = getuid ();
- #ifdef HAVE_SETRESUID
- if (0 != setresuid (uid, 0, 0))
{
- fprintf (stderr, "Failed to setresuid to root: %s\n", strerror (errno));
- return 254;
- }
- #else
- if (0 != seteuid (0))
- {
- fprintf (stderr, "Failed to seteuid back to root: %s\n", strerror (errno));
- return 254;
+#ifdef HAVE_SETRESUID
+ uid_t uid = getuid ();
+
+ if (0 != setresuid (uid, 0, 0))
+ {
+ fprintf (stderr,
+ "Failed to setresuid to root: %s\n",
+ strerror (errno));
+ return 254;
+ }
+#else
+ if (0 != seteuid (0))
+ {
+ fprintf (stderr,
+ "Failed to seteuid back to root: %s\n", strerror (errno));
+ return 254;
+ }
+#endif
}
- #endif
/* Make use of SGID capabilities on POSIX */
memset (&dev, 0, sizeof (dev));
diff --git a/src/transport/gnunet-helper-transport-wlan.c b/src/transport/gnunet-helper-transport-wlan.c
index 8a978c218..cbe0dae77 100644
--- a/src/transport/gnunet-helper-transport-wlan.c
+++ b/src/transport/gnunet-helper-transport-wlan.c
@@ -1923,23 +1923,28 @@ main (int argc, char *argv[])
int stdin_open;
struct MessageStreamTokenizer *stdin_mst;
int raw_eno;
- uid_t uid;
/* assert privs so we can modify the firewall rules! */
- uid = getuid ();
-#ifdef HAVE_SETRESUID
- if (0 != setresuid (uid, 0, 0))
{
- fprintf (stderr, "Failed to setresuid to root: %s\n", strerror (errno));
- return 254;
- }
+#ifdef HAVE_SETRESUID
+ uid_t uid = getuid ();
+
+ if (0 != setresuid (uid, 0, 0))
+ {
+ fprintf (stderr,
+ "Failed to setresuid to root: %s\n",
+ strerror (errno));
+ return 254;
+ }
#else
- if (0 != seteuid (0))
- {
- fprintf (stderr, "Failed to seteuid back to root: %s\n", strerror (errno));
- return 254;
- }
+ if (0 != seteuid (0))
+ {
+ fprintf (stderr,
+ "Failed to seteuid back to root: %s\n", strerror (errno));
+ return 254;
+ }
#endif
+ }
/* make use of SGID capabilities on POSIX */
memset (&dev, 0, sizeof (dev));
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index 048bd00cf..b4130f945 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -1381,6 +1381,7 @@ server_lookup_connection (struct HTTP_Server_Plugin *plugin,
method,
url);
stc.tag = 0;
+ options = 0; /* make gcc happy */
if (GNUNET_SYSERR ==
server_parse_url (plugin, url, &target, &stc.tag, &options))
{