From 4b60d5c2a43c0683154818bfda8b1cfe06a3c861 Mon Sep 17 00:00:00 2001 From: David Timber Date: Wed, 27 Nov 2024 12:01:22 +0100 Subject: Patch writeups/ipv6/eyeball ... - Fix -h option - Add "clean" target - In poll_result(): break on error --- writeups/ipv6/eyeball/Makefile | 7 ++++++- writeups/ipv6/eyeball/eyeball.c | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/writeups/ipv6/eyeball/Makefile b/writeups/ipv6/eyeball/Makefile index 939a53d..14ccb9d 100644 --- a/writeups/ipv6/eyeball/Makefile +++ b/writeups/ipv6/eyeball/Makefile @@ -1,3 +1,8 @@ - eyeball: eyeball.c cc -g -O0 -Wall -Wextra eyeball.c -o eyeball + +.PHONY: clean + +clean: + rm -f eyeball + diff --git a/writeups/ipv6/eyeball/eyeball.c b/writeups/ipv6/eyeball/eyeball.c index fc01773..6ada24b 100644 --- a/writeups/ipv6/eyeball/eyeball.c +++ b/writeups/ipv6/eyeball/eyeball.c @@ -303,6 +303,10 @@ bool parse_args (const int argc, const char **argv) { } } + if (opts.flags.help) { + return true; + } + if (argc < optind + 2) { fprintf(stderr, ARGV0": too few arguments\n"); return false; @@ -450,7 +454,7 @@ ssize_t poll_result (void) { if (g.th[0].err.ready && g.th[1].err.ready) { // both failed - return -1; + break; } // both still trying -- cgit