diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1997-02-18 03:57:19 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1997-02-18 03:57:19 +0000 |
commit | e70d6db9a9513c6e2040f118264b1dd606ca5fe6 (patch) | |
tree | 3f0c631bae6e5b01903c5b006fe43dc2ab59192e | |
parent | 87e5598795b289a87f80ff147bebb6753c9ff73e (diff) | |
download | fetchmail-e70d6db9a9513c6e2040f118264b1dd606ca5fe6.tar.gz fetchmail-e70d6db9a9513c6e2040f118264b1dd606ca5fe6.tar.bz2 fetchmail-e70d6db9a9513c6e2040f118264b1dd606ca5fe6.zip |
Dave Bodenstab's error-message corrections.
svn path=/trunk/; revision=900
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | driver.c | 2 | ||||
-rw-r--r-- | rcfile_y.y | 2 | ||||
-rw-r--r-- | report.c | 40 |
4 files changed, 23 insertions, 23 deletions
@@ -12,6 +12,8 @@ bugs -- * Fix password-shrouding logic so it doesn't crap out on a zero-length password. +* Various error-logging fixes by Dave Bodenstab. + ------------------------------------------------------------------------------ fetchmail-3.6 (Mon Feb 17 00:19:55 EST 1997) @@ -1132,7 +1132,7 @@ const struct method *proto; /* protocol method table */ #ifndef EHOSTUNREACH #define EHOSTUNREACH (-1) #endif - if (errno != EHOSTUNREACH) + if (outlevel == O_VERBOSE || errno != EHOSTUNREACH) error(0, errno, "connecting to host"); ok = PS_SOCKET; goto closeUp; @@ -217,7 +217,7 @@ static struct query *hosttail; /* where to add new elements */ void yyerror (const char *s) /* report a syntax error */ { - fprintf(stderr,"%s line %d: %s at %s\n", rcfile, prc_lineno, s, yytext); + error_at_line( 0, 0, rcfile, prc_lineno, "%s at %s", s, yytext ); prc_errflag++; } @@ -315,8 +315,7 @@ error_build (message, va_alist) partial_message = xrealloc (partial_message, partial_message_size); } #else - VA_START (args, message); - vsprintf (partial_message + partial_message_size_used, message, args); + sprintf (partial_message + partial_message_size_used, message, a1, a2, a3, a4, a5, a6, a7, a8); /* Attempt to catch memory overwrites... */ if ((partial_message_size_used = strlen (partial_message)) >= partial_message_size) @@ -324,7 +323,6 @@ error_build (message, va_alist) partial_message_size_used = 0; error (PS_UNDEFINED, 0, "partial error message buffer overflow"); } - va_end (args); #endif #endif @@ -407,8 +405,7 @@ error_complete (status, errnum, message, va_alist) partial_message = xrealloc (partial_message, partial_message_size); } #else - VA_START (args, message); - vsprintf (partial_message + partial_message_size_used, message, args); + sprintf (partial_message + partial_message_size_used, message, a1, a2, a3, a4, a5, a6, a7, a8); /* Attempt to catch memory overwrites... */ if ((partial_message_size_used = strlen (partial_message)) >= partial_message_size) @@ -416,28 +413,29 @@ error_complete (status, errnum, message, va_alist) partial_message_size_used = 0; error (PS_UNDEFINED, 0, "partial error message buffer overflow"); } - va_end (args); #endif #endif /* Finally... print it. */ - if (partial_message_size_used != 0) + partial_message_size_used = 0; + + if (use_stderr) { - partial_message_size_used = 0; - if (use_stderr) - { - fputs(partial_message, stderr); - if (errnum) - fprintf (stderr, ": %s", strerror (errnum)); - putc ('\n', stderr); - fflush (stderr); - ++error_message_count; - if (status) - exit(status); - } - else - error (status, errnum, "%s", partial_message); + fputs(partial_message, stderr); + + if (errnum) + fprintf (stderr, ": %s", strerror (errnum)); + + putc ('\n', stderr); + fflush (stderr); + + ++error_message_count; + + if (status) + exit(status); } + else + error (status, errnum, "%s", partial_message); } /* Sometimes we want to have at most one error per line. This |