aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/tftp/main.c
diff options
context:
space:
mode:
authorBrian S. Dean <bsd@FreeBSD.org>2002-05-12 01:47:50 +0000
committerBrian S. Dean <bsd@FreeBSD.org>2002-05-12 01:47:50 +0000
commit73f899cae1cfb9507d72ef5ec9a9d0a02af9d005 (patch)
treee713f0ed3baada1e80ddc3aa03a7abdecc27f23a /usr.bin/tftp/main.c
parent11612afabebfb0500b667501c6ffadbbc8747eb6 (diff)
downloadsrc-73f899cae1cfb9507d72ef5ec9a9d0a02af9d005.tar.gz
src-73f899cae1cfb9507d72ef5ec9a9d0a02af9d005.zip
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)
Notes
Notes: svn path=/head/; revision=96433
Diffstat (limited to 'usr.bin/tftp/main.c')
-rw-r--r--usr.bin/tftp/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c
index 7da91841a5b9..ad3658b76ff8 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);
}
/*