Date: Sat, 11 Apr 2015 05:20:02 +0000 (UTC) From: Garrett Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281404 - head/tools/regression/sockets/zerosend Message-ID: <201504110520.t3B5K21W082732@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Sat Apr 11 05:20:01 2015 New Revision: 281404 URL: https://svnweb.freebsd.org/changeset/base/281404 Log: Generate temporary files with mkstemp instead of mktemp MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/sockets/zerosend/zerosend.c Modified: head/tools/regression/sockets/zerosend/zerosend.c ============================================================================== --- head/tools/regression/sockets/zerosend/zerosend.c Sat Apr 11 03:57:35 2015 (r281403) +++ head/tools/regression/sockets/zerosend/zerosend.c Sat Apr 11 05:20:01 2015 (r281404) @@ -209,12 +209,12 @@ setup_pipe(const char *test, int *fdp) static void setup_fifo(const char *test, int *fdp) { - char path[PATH_MAX]; + char path[] = "0send_fifo.XXXXXXX"; int fd1, fd2; - strcpy(path, "/tmp/0send_fifo.XXXXXXX"); - if (mktemp(path) == NULL) + if (mkstemp(path) == -1) err(-1, "%s: setup_fifo: mktemp", test); + unlink(path); if (mkfifo(path, 0600) < 0) err(-1, "%s: setup_fifo: mkfifo(%s)", test, path);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504110520.t3B5K21W082732>