diff options
author | peter <peter@FreeBSD.org> | 1999-03-18 09:21:42 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-03-18 09:21:42 +0000 |
commit | 308b60f66831aa65a459a7b347ea6ca14b6e4799 (patch) | |
tree | 1b2cd3bad90a2dd8ccb449f73ddfb9e295c0737d /contrib/cvs/src/error.c | |
parent | 0c111e2b51cac7eead56494b30c5977e4ec9a8ea (diff) | |
download | FreeBSD-src-308b60f66831aa65a459a7b347ea6ca14b6e4799.zip FreeBSD-src-308b60f66831aa65a459a7b347ea6ca14b6e4799.tar.gz |
Import cvs-1.10 onto vendor branch. Merge to follow shortly.
Obtained from: cyclic.com
Diffstat (limited to 'contrib/cvs/src/error.c')
-rw-r--r-- | contrib/cvs/src/error.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/contrib/cvs/src/error.c b/contrib/cvs/src/error.c index cb69bde..9dcc162 100644 --- a/contrib/cvs/src/error.c +++ b/contrib/cvs/src/error.c @@ -89,7 +89,15 @@ error_exit PROTO ((void)) thing for the server, whether the normal server_active (child process) case or the error_use_protocol (parent process) case. The one exception is that STATUS nonzero for error_use_protocol probably doesn't work yet; - in that case still need to use the pending_error machinery in server.c. */ + in that case still need to use the pending_error machinery in server.c. + + error() does not molest errno; some code (e.g. Entries_Open) depends + on being able to say something like: + error (0, 0, "foo"); + error (0, errno, "bar"); + + */ + /* VARARGS */ void #if defined (HAVE_VPRINTF) && defined (__STDC__) @@ -102,6 +110,9 @@ error (status, errnum, message, va_alist) va_dcl #endif { + /* Prevent strtoul (via int_vasprintf) from clobbering it. */ + int save_errno = errno; + #ifdef HAVE_VPRINTF if (message[0] != '\0') { @@ -211,6 +222,7 @@ error (status, errnum, message, va_alist) if (status) error_exit (); + errno = save_errno; } /* Print the program name and error message MESSAGE, which is a printf-style |