Skip to content

Commit 6a47d49

Browse files
committed
Use ".dup.darshan" suffix for duplicated log file name
1 parent 6a5c60f commit 6a47d49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

darshan-runtime/lib/darshan-core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,8 @@ void darshan_core_shutdown(int write_log)
497497
err = close(mmap_fd);
498498
if (err < 0)
499499
darshan_core_fprintf(stderr, "darshan:log duplication close (%s)\n", strerror(errno));
500-
snprintf(dup_log_fame, strlen(final_core->mmap_log_name)+5, "%s.dup",
501-
final_core->mmap_log_name);
500+
strncpy(dup_log_fame, final_core->mmap_log_name, __DARSHAN_PATH_MAX);
501+
strcat(strstr(dup_log_fame, ".darshan"), ".dup.darshan");
502502
dup_mmap_fd = open(dup_log_fame, O_CREAT | O_WRONLY, 0644);
503503
if (dup_mmap_fd != -1) {
504504
ssize_t wlen = write(dup_mmap_fd, buf, final_core->mmap_size);

0 commit comments

Comments
 (0)