diff options
-rw-r--r-- | tests/zfs-tests/tests/functional/ctime/ctime_001_pos.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/zfs-tests/tests/functional/ctime/ctime_001_pos.c b/tests/zfs-tests/tests/functional/ctime/ctime_001_pos.c index 0c0615ff5..e1b244ee9 100644 --- a/tests/zfs-tests/tests/functional/ctime/ctime_001_pos.c +++ b/tests/zfs-tests/tests/functional/ctime/ctime_001_pos.c @@ -145,17 +145,19 @@ do_link(const char *pfile) { int ret = 0; char link_file[BUFSIZ] = { 0 }; + char pfile_copy[BUFSIZ] = { 0 }; char *dname; if (pfile == NULL) { return (-1); } + strcpy(pfile_copy, pfile); /* * Figure out source file directory name, and create * the link file in the same directory. */ - dname = dirname((char *)pfile); + dname = dirname((char *)pfile_copy); (void) snprintf(link_file, BUFSIZ, "%s/%s", dname, "link_file"); if (link(pfile, link_file) == -1) { |