noip.c: Silence GCC warnings about unused return values.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 5 Jun 2010 10:53:37 +0000 (11:53 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 5 Jun 2010 10:53:37 +0000 (11:53 +0100)
Actually act on errors from fgets while skipping the header on
/proc/net/unix, even though it's unlikely to be bad and we'll fail
later anyway.  The write in printerr is not worth worrying about.

noip.c

diff --git a/noip.c b/noip.c
index 9633990..bcba77f 100644 (file)
--- a/noip.c
+++ b/noip.c
@@ -266,7 +266,7 @@ static int unix_socket_status(struct sockaddr_un *sun, int quickp)
   rc = USED;
   if ((fp = fopen("/proc/net/unix", "r")) == 0)
     goto done;
-  fgets(buf, sizeof(buf), fp); /* skip header */
+  if (!fgets(buf, sizeof(buf), fp)) goto done; /* skip header */
   len = strlen(sun->sun_path);
   while (fgets(buf, sizeof(buf), fp)) {
     n = strlen(buf);
@@ -1104,7 +1104,8 @@ static void get_local_ipaddrs(void)
 }
 
 /* Print the given message to standard error.  Avoids stdio. */
-static void printerr(const char *p) { write(STDERR_FILENO, p, strlen(p)); }
+static void printerr(const char *p)
+  { int hunoz; hunoz = write(STDERR_FILENO, p, strlen(p)); }
 
 /* Create the socket directory, being careful about permissions. */
 static void create_sockdir(void)