From 72d85cdbe2c457efb39bfe1a9c73ce2f75d7f36f Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 5 Jun 2010 11:53:37 +0100 Subject: [PATCH] noip.c: Silence GCC warnings about unused return values. 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/noip.c b/noip.c index 9633990..bcba77f 100644 --- 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) -- 2.11.0