commit 34a7b62dc2cc6c3b1d900e6441a00b8ecb7cab77
parent 631357bb9184f76227d82dab74144118aaca3ad0
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Thu, 16 Mar 2023 03:02:40 +0100
driver/posix: Don't write to stdout with -S
When -S is used we don't want the assembly output
in stdout that is needed only when we have other
stage.
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/cmd/cc/posix/cc.c b/src/cmd/cc/posix/cc.c
@@ -358,8 +358,12 @@ spawn(int tool)
dup2(t->out, 1);
if (t->in > -1)
dup2(t->in, 0);
+
+ if (tool == TEEAS && Sflag)
+ dup2(devnullfd, 1);
if (!dflag && tool != CC1 && tool != LD)
dup2(devnullfd, 2);
+
if (dflag) {
fprintf(stderr, "%s", t->cmd);
for (ap = t->args.s+1; *ap; ap++)