Date: Sat, 11 Apr 2015 03:18:15 +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: r281394 - head/tools/regression/sockets/sendfile Message-ID: <201504110318.t3B3IFme025784@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Sat Apr 11 03:18:14 2015 New Revision: 281394 URL: https://svnweb.freebsd.org/changeset/base/281394 Log: - Don't use /tmp because it's outside ATF's prescribed sandbox - Replace a hardcoded PATH_MAX value with sizeof(path) - Use path like an array, not a pointer, and always try to unlink it in cleanup MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/sockets/sendfile/sendfile.c Modified: head/tools/regression/sockets/sendfile/sendfile.c ============================================================================== --- head/tools/regression/sockets/sendfile/sendfile.c Sat Apr 11 03:13:09 2015 (r281393) +++ head/tools/regression/sockets/sendfile/sendfile.c Sat Apr 11 03:18:14 2015 (r281394) @@ -452,8 +452,8 @@ run_parent(void) static void cleanup(void) { - if (*path != '\0') - unlink(path); + + unlink(path); } int @@ -461,12 +461,12 @@ main(int argc, char *argv[]) { int pagesize; - *path = '\0'; + path[0] = '\0'; pagesize = getpagesize(); if (argc == 1) { - snprintf(path, PATH_MAX, "/tmp/sendfile.XXXXXXXXXXXX"); + snprintf(path, sizeof(path), "sendfile.XXXXXXXXXXXX"); file_fd = mkstemp(path); if (file_fd == -1) FAIL_ERR("mkstemp");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504110318.t3B3IFme025784>