From: Ruediger Meier <sweet_f_a@gmx.de>
To: Assaf Gordon <assafgordon@gmail.com>
Cc: Karel Zak <kzak@redhat.com>, util-linux@vger.kernel.org
Subject: Re: [ANNOUNCE] util-linux v2.30-rc2
Date: Wed, 31 May 2017 22:03:53 +0200 [thread overview]
Message-ID: <201705312203.53697.sweet_f_a@gmx.de> (raw)
In-Reply-To: <20170531174139.GA30064@gmail.com>
On Wednesday 31 May 2017, Assaf Gordon wrote:
> rename: exit codes ... FAILED (rename/exit_codes)
This is because stdout and stderr are mixed:
musl seems to behave like the patch below, while glibc always prints
the "wrong" order.
--------------
diff --git a/misc-utils/rename.c b/misc-utils/rename.c
index 502e888..edfc4e0 100644
--- a/misc-utils/rename.c
+++ b/misc-utils/rename.c
@@ -103,10 +103,13 @@ static int do_file(char *from, char *to, char *s,
int verbose, int noact)
return 0;
else if (!noact && rename(s, newname) != 0) {
warn(_("%s: rename to %s failed"), s, newname);
+ fflush(stderr);
ret = 2;
}
- if (verbose && (noact || ret == 1))
+ if (verbose && (noact || ret == 1)) {
printf("`%s' -> `%s'\n", s, newname);
+ fflush(stdout);
+ }
free(newname);
return ret;
}
-------------
Not sure whether we should really use fflush() to define the order of
error and non-error messages. We could also simply "fix" the the test
script by not using "--verbose". or by using "stdbuf -o0 -e0
rename ..."
cu,
Rudi
prev parent reply other threads:[~2017-05-31 20:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-23 10:50 [ANNOUNCE] util-linux v2.30-rc2 Karel Zak
2017-05-30 5:03 ` Assaf Gordon
2017-05-30 9:27 ` Karel Zak
2017-05-30 13:28 ` Karel Zak
2017-05-30 15:18 ` Karel Zak
2017-05-31 3:48 ` Assaf Gordon
2017-05-31 9:16 ` Karel Zak
2017-05-31 17:41 ` Assaf Gordon
2017-05-31 18:36 ` Ruediger Meier
2017-05-31 20:05 ` Assaf Gordon
2017-05-31 20:36 ` Ruediger Meier
2017-05-31 20:03 ` Ruediger Meier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201705312203.53697.sweet_f_a@gmx.de \
--to=sweet_f_a@gmx.de \
--cc=assafgordon@gmail.com \
--cc=kzak@redhat.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox