summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
86b1fbb)
Some errors, e.g. EPIPE, cause the advise()'s call to another
advertise() to fail again, ad segvinitum when stack busts. Instead,
snprintf(3) and write(2) that single string, ignoring any error.
iov->iov_len = strlen (iov->iov_base = "\n");
iov++;
if (writev (fileno (stderr), iob, iov - iob) < 0) {
iov->iov_len = strlen (iov->iov_base = "\n");
iov++;
if (writev (fileno (stderr), iob, iov - iob) < 0) {
- advise ("stderr", "writev");
+ snprintf(buffer, sizeof buffer, "%s: write stderr failed: %d\n",
+ invo_name && *invo_name ? invo_name : "nmh", errno);
+ if (write(2, buffer, strlen(buffer)) == -1) {
+ /* Ignore. if-statement needed to shut up compiler. */
+ }