diff --git a/libexec/tftpd/tftp-utils.c b/libexec/tftpd/tftp-utils.c --- a/libexec/tftpd/tftp-utils.c +++ b/libexec/tftpd/tftp-utils.c @@ -35,6 +35,7 @@ #include #include +#include #include #include #include @@ -148,8 +149,10 @@ tftp_log(int priority, const char *message, ...) { va_list ap; + int serrno; char *s; + serrno = errno; va_start(ap, message); if (_tftp_logtostdout == 0) { vasprintf(&s, message, ap); @@ -159,6 +162,7 @@ printf("\n"); } va_end(ap); + errno = serrno; } /*