Skip to content

Commit

Permalink
initialize st_buf.st_mode to silence valgrind warning
Browse files Browse the repository at this point in the history
  • Loading branch information
wkliao committed Feb 13, 2024
1 parent 88438f0 commit f9fa7b5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/drivers/ncmpio/ncmpio_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ ncmpio_create(MPI_Comm comm,

/* Check if the file already exists, if lstat() or access() is available */
#ifdef HAVE_LSTAT
struct stat st_buf;
/* call lstat() to check the file if exists and if is a symbolic link */
if (rank == 0) {
struct stat st_buf;
st_buf.st_mode = 0;

if (lstat(filename, &st_buf) == -1) file_exist = 0;
errno = 0; /* reset errno */

Expand Down

0 comments on commit f9fa7b5

Please sign in to comment.