diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2011-02-10 21:31:36 -0500 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2011-02-10 21:31:36 -0500 |
commit | e615815e1d0f299b0639a5b2bebebd147a1bf22b (patch) | |
tree | 49b62f2faa880d2845627abd0f3f1fbb884444e2 | |
parent | Add rudimentry host filter. (diff) | |
download | lastlog-e615815e1d0f299b0639a5b2bebebd147a1bf22b.tar.xz lastlog-e615815e1d0f299b0639a5b2bebebd147a1bf22b.zip |
Build optimized and suppress warning on write error.
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | utmpr.c | 5 |
2 files changed, 5 insertions, 2 deletions
@@ -1,4 +1,4 @@ -CFLAGS=-g +CFLAGS=-O2 -Wall utmpr: clean: rm -f utmpr @@ -198,7 +198,10 @@ void text_to_binary(FILE *fp) (ip_n[0])); //TODO: ipv6 addresses... - fwrite(&entry, sizeof(struct utmp), 1, output_file); + if (!fwrite(&entry, sizeof(struct utmp), 1, output_file)) { + fprintf(stderr, "%s: Could not write output\n", program_name); + exit(EXIT_FAILURE); + } } } |