public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jackie Liu <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: [PATCH liburing 1/3] mktemp is dangerous, better use mkostemp
Date: Wed, 20 Nov 2019 11:14:20 +0800	[thread overview]
Message-ID: <[email protected]> (raw)

jackieliu@aarch64:~/liburing$ make -C test
...
/tmp/ccoJ4CQ4.o: In function `main':
/home/jackieliu/liburing/test/500f9fbadef8-test.c:41: warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'

Signed-off-by: Jackie Liu <[email protected]>
---
 test/500f9fbadef8-test.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/test/500f9fbadef8-test.c b/test/500f9fbadef8-test.c
index 88602ad..b480944 100644
--- a/test/500f9fbadef8-test.c
+++ b/test/500f9fbadef8-test.c
@@ -38,10 +38,9 @@ int main(int argc, char *argv[])
 	}
 
 	sprintf(buf, "./XXXXXX");
-	mktemp(buf);
-	fd = open(buf, O_WRONLY | O_DIRECT | O_CREAT, 0644);
+	fd = mkostemp(buf, O_WRONLY | O_DIRECT | O_CREAT);
 	if (fd < 0) {
-		perror("mkstemp");
+		perror("mkostemp");
 		return 1;
 	}
 
-- 
2.17.1




             reply	other threads:[~2019-11-20  3:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-20  3:14 Jackie Liu [this message]
2019-11-20  3:14 ` [PATCH liburing 2/3] Avoid redefined warning of "SIGSTKSZ" Jackie Liu
2019-11-20  3:14 ` [PATCH liburing 3/3] built liburing.so and test binary first when runtests Jackie Liu
2019-11-20  3:36 ` [PATCH liburing 1/3] mktemp is dangerous, better use mkostemp Jens Axboe

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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