Be more POSIX compliant w.r.t. errno; fixes erroneousl reporting of errors on FreeBSD
parent
e55c47697b
commit
988f8303c7
|
@ -72,7 +72,7 @@ int main(int argc, char const * arg[])
|
|||
soxr_delete(soxr);
|
||||
free(obuf), free(ibuf);
|
||||
/* Diagnostics: */
|
||||
fprintf(stderr, "%-26s %s; I/O: %s\n", arg[0],
|
||||
soxr_strerror(error), errno? strerror(errno) : "no error");
|
||||
return error || errno;
|
||||
fprintf(stderr, "%-26s %s; I/O: %s\n", arg[0], soxr_strerror(error),
|
||||
ferror(stdin) || ferror(stdout)? strerror(errno) : "no error");
|
||||
return !!error;
|
||||
}
|
||||
|
|
|
@ -104,7 +104,8 @@ int main(int n, char const * arg[])
|
|||
soxr_delete(soxr);
|
||||
free(obuf), free(ibuf);
|
||||
/* Diagnostics: */
|
||||
fprintf(stderr, "%-26s %s; %lu clips; I/O: %s\n", arg0, soxr_strerror(error),
|
||||
(long unsigned)clips, errno? strerror(errno) : "no error");
|
||||
return error || errno;
|
||||
fprintf(stderr, "%-26s %s; %lu clips; I/O: %s\n",
|
||||
arg0, soxr_strerror(error), (long unsigned)clips,
|
||||
ferror(stdin) || ferror(stdout)? strerror(errno) : "no error");
|
||||
return !!error;
|
||||
}
|
||||
|
|
|
@ -141,7 +141,8 @@ int main(int n, char const * arg[])
|
|||
free(obuf), free(ibuf), free(obufs), free(ibufs);
|
||||
free(obuf_ptrs), free(ibuf_ptrs);
|
||||
/* Diagnostics: */
|
||||
fprintf(stderr, "%-26s %s; %lu clips; I/O: %s\n", arg0, soxr_strerror(error),
|
||||
(long unsigned)clips, errno? strerror(errno) : "no error");
|
||||
return error || errno;
|
||||
fprintf(stderr, "%-26s %s; %lu clips; I/O: %s\n",
|
||||
arg0, soxr_strerror(error), (long unsigned)clips,
|
||||
ferror(stdin) || ferror(stdout)? strerror(errno) : "no error");
|
||||
return !!error;
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ int main(int argc, char *arg[])
|
|||
soxr_delete(soxr);
|
||||
}
|
||||
/* Diagnostics: */
|
||||
fprintf(stderr, "%-26s %s; I/O: %s\n", arg[0],
|
||||
soxr_strerror(error), errno? strerror(errno) : "no error");
|
||||
return error || errno;
|
||||
fprintf(stderr, "%-26s %s; I/O: %s\n", arg[0], soxr_strerror(error),
|
||||
ferror(stdin) || ferror(stdout)? strerror(errno) : "no error");
|
||||
return !!error;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue