diff options
author | David Timber <dxdt@dev.snart.me> | 2024-11-27 12:01:22 +0100 |
---|---|---|
committer | David Timber <dxdt@dev.snart.me> | 2024-11-27 12:01:55 +0100 |
commit | 4b60d5c2a43c0683154818bfda8b1cfe06a3c861 (patch) | |
tree | 9a9ab8645985375e639a27ac4168bc89f8a8d5d0 /writeups | |
parent | 4c6930d481264d7f52d7502d8e6009f39a23a338 (diff) |
Patch writeups/ipv6/eyeball ...
- Fix -h option
- Add "clean" target
- In poll_result(): break on error
Diffstat (limited to 'writeups')
-rw-r--r-- | writeups/ipv6/eyeball/Makefile | 7 | ||||
-rw-r--r-- | 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 |