Skip to content

Commit f9fa7b5

Browse files
committed
initialize st_buf.st_mode to silence valgrind warning
1 parent 88438f0 commit f9fa7b5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/drivers/ncmpio/ncmpio_create.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,11 @@ ncmpio_create(MPI_Comm comm,
8484

8585
/* Check if the file already exists, if lstat() or access() is available */
8686
#ifdef HAVE_LSTAT
87-
struct stat st_buf;
8887
/* call lstat() to check the file if exists and if is a symbolic link */
8988
if (rank == 0) {
89+
struct stat st_buf;
90+
st_buf.st_mode = 0;
91+
9092
if (lstat(filename, &st_buf) == -1) file_exist = 0;
9193
errno = 0; /* reset errno */
9294

0 commit comments

Comments
 (0)