mirror of
https://github.com/mirror/make.git
synced 2025-03-29 05:20:28 +08:00
* src/output.c (_outputs): Don't use invalid output sync FDs
Just write to stdout/stderr in this situation.
This commit is contained in:
parent
deb4a42c3e
commit
41c35f2ffe
26
src/output.c
26
src/output.c
@ -51,20 +51,24 @@ unsigned int stdio_traced = 0;
|
|||||||
static void
|
static void
|
||||||
_outputs (struct output *out, int is_err, const char *msg)
|
_outputs (struct output *out, int is_err, const char *msg)
|
||||||
{
|
{
|
||||||
if (! out || ! out->syncout)
|
FILE *f;
|
||||||
{
|
|
||||||
FILE *f = is_err ? stderr : stdout;
|
if (out && out->syncout)
|
||||||
fputs (msg, f);
|
|
||||||
fflush (f);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
int fd = is_err ? out->err : out->out;
|
int fd = is_err ? out->err : out->out;
|
||||||
size_t len = strlen (msg);
|
if (fd != OUTPUT_NONE)
|
||||||
int r;
|
{
|
||||||
EINTRLOOP (r, lseek (fd, 0, SEEK_END));
|
size_t len = strlen (msg);
|
||||||
writebuf (fd, msg, len);
|
int r;
|
||||||
|
EINTRLOOP (r, lseek (fd, 0, SEEK_END));
|
||||||
|
writebuf (fd, msg, len);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
f = is_err ? stderr : stdout;
|
||||||
|
fputs (msg, f);
|
||||||
|
fflush (f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write a message indicating that we've just entered or
|
/* Write a message indicating that we've just entered or
|
||||||
|
Loading…
Reference in New Issue
Block a user