io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH liburing 1/3] mktemp is dangerous, better use mkostemp
@ 2019-11-20  3:14 Jackie Liu
  2019-11-20  3:14 ` [PATCH liburing 2/3] Avoid redefined warning of "SIGSTKSZ" Jackie Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jackie Liu @ 2019-11-20  3:14 UTC (permalink / raw)
  To: axboe; +Cc: io-uring

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 <liuyun01@kylinos.cn>
---
 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




^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-11-20  3:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-20  3:14 [PATCH liburing 1/3] mktemp is dangerous, better use mkostemp Jackie Liu
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).