diff options
author | bsd <bsd@FreeBSD.org> | 2002-05-12 01:47:50 +0000 |
---|---|---|
committer | bsd <bsd@FreeBSD.org> | 2002-05-12 01:47:50 +0000 |
commit | 7fd0cc174c07ea70fe9b483daadcc127d40fab92 (patch) | |
tree | e713f0ed3baada1e80ddc3aa03a7abdecc27f23a /usr.bin/tftp/main.c | |
parent | 9cc64ca23caaf7825c2002b6dbd81be05666b80f (diff) | |
download | FreeBSD-src-7fd0cc174c07ea70fe9b483daadcc127d40fab92.zip FreeBSD-src-7fd0cc174c07ea70fe9b483daadcc127d40fab92.tar.gz |
To perform even basic error checking, one must have an exit code that
indicates that not everything worked as expected. Exit non-zero if we
timed out while transmitting or receiving a file or if the file did
not exist, etc.
MFC After: 3 days (re@ willing)
Diffstat (limited to 'usr.bin/tftp/main.c')
-rw-r--r-- | usr.bin/tftp/main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c index 7da9184..ad3658b 100644 --- a/usr.bin/tftp/main.c +++ b/usr.bin/tftp/main.c @@ -87,6 +87,7 @@ char line[MAXLINE]; int margc; char *margv[20]; jmp_buf toplevel; +volatile int txrx_error; void get(int, char **); void help(int, char **); @@ -164,7 +165,7 @@ main(argc, argv) signal(SIGINT, intr); if (argc > 1) { if (setjmp(toplevel) != 0) - exit(0); + exit(txrx_error); setpeer(argc, argv); } if (setjmp(toplevel) != 0) @@ -651,7 +652,7 @@ command() } else { if (fgets(line, sizeof line , stdin) == 0) { if (feof(stdin)) { - exit(0); + exit(txrx_error); } else { continue; } @@ -739,8 +740,7 @@ quit(argc, argv) int argc __unused; char *argv[] __unused; { - - exit(0); + exit(txrx_error); } /* |