summaryrefslogtreecommitdiffhomepage
path: root/src/output
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-08-05 04:38:05 -0400
committermidipix <writeonce@midipix.org>2018-08-05 04:52:35 -0400
commit58ff53ecb9f51ce0724d30e81bc14098a04a5bea (patch)
tree895b6befe2cea3b455ecf2f07ad4903374e759cf /src/output
parentec000532ee50c64e66a76114b745f6804901bab9 (diff)
downloadntux-58ff53ecb9f51ce0724d30e81bc14098a04a5bea.tar.bz2
ntux-58ff53ecb9f51ce0724d30e81bc14098a04a5bea.tar.xz
ntux_output_error_record_plain(): integrated the driver's fdctx.
Diffstat (limited to 'src/output')
-rw-r--r--src/output/ntux_output_error.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/output/ntux_output_error.c b/src/output/ntux_output_error.c
index 3848503..b500eb5 100644
--- a/src/output/ntux_output_error.c
+++ b/src/output/ntux_output_error.c
@@ -80,6 +80,7 @@ static int ntux_output_error_record_plain(
{
const char * epath;
const char * errdesc = ntux_output_strerror(dctx,erri);
+ int fderr = ntux_driver_fderr(dctx);
epath = erri->euctx
? *erri->euctx->path
@@ -87,7 +88,7 @@ static int ntux_output_error_record_plain(
if (epath && !(erri->eflags & NTUX_ERROR_NESTED))
if (ntux_dprintf(
- STDERR_FILENO,
+ fderr,
"%s: [%s] '%s':\n",
dctx->program,
ntux_output_unit_header(erri),
@@ -95,7 +96,7 @@ static int ntux_output_error_record_plain(
return -1;
if (ntux_dprintf(
- STDERR_FILENO,
+ fderr,
"%s: %s %s(), line %d%s%s.\n",
dctx->program,
ntux_output_error_header(erri),
@@ -114,6 +115,7 @@ static int ntux_output_error_record_annotated(
{
const char * epath;
const char * errdesc = ntux_output_strerror(dctx,erri);
+ int fderr = ntux_driver_fderr(dctx);
epath = erri->euctx
? *erri->euctx->path
@@ -121,7 +123,7 @@ static int ntux_output_error_record_annotated(
if (epath && !(erri->eflags & NTUX_ERROR_NESTED))
if (ntux_dprintf(
- STDERR_FILENO,
+ fderr,
"%s%s%s:%s %s[%s]%s %s%s'%s'%s:\n",
aclr_bold,aclr_magenta,
@@ -138,7 +140,7 @@ static int ntux_output_error_record_annotated(
return -1;
if (ntux_dprintf(
- STDERR_FILENO,
+ fderr,
"%s%s%s:%s %s%s%s %s%s%s()%s, %s%sline %d%s%s%s%s%s.\n",
aclr_bold,aclr_magenta,
@@ -176,7 +178,7 @@ int ntux_output_error_record(
else if (dctx->cctx->drvflags & NTUX_DRIVER_ANNOTATE_ALWAYS)
return ntux_output_error_record_annotated(dctx,erri);
- else if (isatty(STDERR_FILENO))
+ else if (isatty(ntux_driver_fderr(dctx)))
return ntux_output_error_record_annotated(dctx,erri);
else
@@ -213,7 +215,7 @@ int ntux_output_error_vector(const struct ntux_driver_ctx * dctx)
else if (dctx->cctx->drvflags & NTUX_DRIVER_ANNOTATE_ALWAYS)
return ntux_output_error_vector_annotated(dctx);
- else if (isatty(STDERR_FILENO))
+ else if (isatty(ntux_driver_fderr(dctx)))
return ntux_output_error_vector_annotated(dctx);
else