X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/5dd6771b28c257af405d7248639ed0e3bcdce38b..2e45544e082577402083dec7e23089d74ac7d89f:/sbr/error.c?ds=sidebyside diff --git a/sbr/error.c b/sbr/error.c index 6dc69957..fd74d270 100644 --- a/sbr/error.c +++ b/sbr/error.c @@ -9,12 +9,8 @@ #include -#ifdef HAVE_WRITEV -# include -# include -#endif - -#include +#include +#include /* @@ -62,25 +58,16 @@ admonish (char *what, char *fmt, ...) /* * main routine for printing error messages. - * - * Use writev() if available, for slightly better performance. - * Why? Well, there are a couple of reasons. Primarily, it - * gives a smoother output... More importantly though, it's a - * sexy syscall()... */ void advertise (char *what, char *tail, char *fmt, va_list ap) { int eindex = errno; - -#ifdef HAVE_WRITEV char buffer[BUFSIZ], err[BUFSIZ]; struct iovec iob[20], *iov; -#endif fflush (stdout); -#ifdef HAVE_WRITEV fflush (stderr); iov = iob; @@ -120,23 +107,4 @@ advertise (char *what, char *tail, char *fmt, va_list ap) iov->iov_len = strlen (iov->iov_base = "\n"); iov++; writev (fileno (stderr), iob, iov - iob); -#else - if (invo_name && *invo_name) - fprintf (stderr, "%s: ", invo_name); - vfprintf (stderr, fmt, ap); - - if (what) { - char *s; - - if (*what) - fprintf (stderr, " %s: ", what); - if ((s = strerror(eindex))) - fprintf (stderr, "%s", s); - else - fprintf (stderr, "Error %d", eindex); - } - if (tail) - fprintf (stderr, ", %s", tail); - fputc ('\n', stderr); -#endif }