From 80b8235497e6ada3a9c999f966f5937538782aba Mon Sep 17 00:00:00 2001 From: matteo Date: Mon, 2 Oct 2006 18:43:57 +0000 Subject: [PATCH] MFC rev. 1.12 and rev. 1.13 rev. 1.12 : use socklen_t where appropriate rev. 1.13 : Set txrx_error to 1 when we reach abort. This makes the program correctly set the exit code. The PR has further details on this. [2] PR: bin/103206 [2] Approved by: re@ (bmah@) --- usr.bin/tftp/tftp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.bin/tftp/tftp.c b/usr.bin/tftp/tftp.c index bac262f9ad7d..c7c2c7e0fdf9 100644 --- a/usr.bin/tftp/tftp.c +++ b/usr.bin/tftp/tftp.c @@ -105,7 +105,7 @@ xmitfile(fd, name, mode) volatile int size, convert; volatile unsigned long amount; struct sockaddr_storage from; - int fromlen; + socklen_t fromlen; FILE *file; struct sockaddr_storage peer; struct sockaddr_storage serv; /* valid server port number */ @@ -205,6 +205,7 @@ abort: stopclock(); if (amount > 0) printstats("Sent", amount); + txrx_error = 1; } /* @@ -223,7 +224,7 @@ recvfile(fd, name, mode) volatile int size, firsttrip; volatile unsigned long amount; struct sockaddr_storage from; - int fromlen; + socklen_t fromlen; FILE *file; volatile int convert; /* true if converting crlf -> lf */ struct sockaddr_storage peer; @@ -330,6 +331,7 @@ abort: /* ok to ack, since user */ stopclock(); if (amount > 0) printstats("Received", amount); + txrx_error = 1; } static int