aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2018-12-03 09:54:46 -0800
committerRob Landley <rob@landley.net>2018-12-03 12:39:30 -0600
commit87c0214c495a998220fa982d88616aab149729e2 (patch)
treeb3fbff34b0c88906ab1dff18055dd9ac9789518f
parentb742998a2671818ceb5295d1a3f2f2c062a39028 (diff)
downloadtoybox-87c0214c495a998220fa982d88616aab149729e2.tar.gz
mktemp: fix warning with glibc 2.15.
Old versions of glibc had warn_unused_result on mktemp(3), despite it always returning its argument. Still, we can silence the warning and save a line, so...
-rw-r--r--toys/lsb/mktemp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/toys/lsb/mktemp.c b/toys/lsb/mktemp.c
index 440cf6b1..ae97e494 100644
--- a/toys/lsb/mktemp.c
+++ b/toys/lsb/mktemp.c
@@ -48,8 +48,7 @@ void mktemp_main(void)
? xstrdup(template) : xmprintf("%s/%s", TT.p, template);
if (toys.optflags & FLAG_u) {
- mktemp(template);
- xputs(template);
+ xputs(mktemp(template));
} else if (toys.optflags & FLAG_d ? !mkdtemp(template) : mkstemp(template) == -1) {
if (toys.optflags & FLAG_q) toys.exitval = 1;
else perror_exit("Failed to create %s %s/%s",