aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-02-18 03:57:19 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-02-18 03:57:19 +0000
commite70d6db9a9513c6e2040f118264b1dd606ca5fe6 (patch)
tree3f0c631bae6e5b01903c5b006fe43dc2ab59192e
parent87e5598795b289a87f80ff147bebb6753c9ff73e (diff)
downloadfetchmail-e70d6db9a9513c6e2040f118264b1dd606ca5fe6.tar.gz
fetchmail-e70d6db9a9513c6e2040f118264b1dd606ca5fe6.tar.bz2
fetchmail-e70d6db9a9513c6e2040f118264b1dd606ca5fe6.zip
Dave Bodenstab's error-message corrections.
svn path=/trunk/; revision=900
-rw-r--r--NEWS2
-rw-r--r--driver.c2
-rw-r--r--rcfile_y.y2
-rw-r--r--report.c40
4 files changed, 23 insertions, 23 deletions
diff --git a/NEWS b/NEWS
index 379bd912..31d7ec4d 100644
--- a/NEWS
+++ b/NEWS
@@ -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)
diff --git a/driver.c b/driver.c
index 98669ecf..a21d7915 100644
--- a/driver.c
+++ b/driver.c
@@ -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;
diff --git a/rcfile_y.y b/rcfile_y.y
index 06f3cd23..029b84de 100644
--- a/rcfile_y.y
+++ b/rcfile_y.y
@@ -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++;
}
diff --git a/report.c b/report.c
index f6fbd765..174abeb9 100644
--- a/report.c
+++ b/report.c
@@ -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