From: Mark Wooding Date: Sat, 5 Jun 2010 10:53:37 +0000 (+0100) Subject: noip.c: Silence GCC warnings about unused return values. X-Git-Tag: 1.0.6~4 X-Git-Url: https://git.distorted.org.uk/~mdw/preload-hacks/commitdiff_plain/72d85cdbe2c457efb39bfe1a9c73ce2f75d7f36f?hp=7d769c69c20563ae0605b34c5f7065137be49024 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. --- 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)