summaryrefslogtreecommitdiff
path: root/mysys/my_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'mysys/my_lib.c')
-rw-r--r--mysys/my_lib.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/mysys/my_lib.c b/mysys/my_lib.c
index ca50699b4c3..fb03f0aa5c2 100644
--- a/mysys/my_lib.c
+++ b/mysys/my_lib.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
- Copyright (c) 2008, 2020, MariaDB Corporation.
+ Copyright (c) 2008, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -332,6 +332,13 @@ int my_fstat(File Filedes, MY_STAT *stat_area,
DBUG_PRINT("my",("fd: %d MyFlags: %lu", Filedes, MyFlags));
#ifdef _WIN32
DBUG_RETURN(my_win_fstat(Filedes, stat_area));
+#elif defined HAVE_valgrind
+ {
+ int s= fstat(Filedes, stat_area);
+ if (!s)
+ MSAN_STAT_WORKAROUND(stat_area);
+ DBUG_RETURN(s);
+ }
#else
DBUG_RETURN(fstat(Filedes, (struct stat *) stat_area));
#endif
@@ -350,11 +357,14 @@ MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags)
my_flags)))
goto error;
#ifndef _WIN32
- if (! stat((char *) path, (struct stat *) stat_area) )
- DBUG_RETURN(stat_area);
+ if (!stat((char *) path, (struct stat *) stat_area))
+ {
+ MSAN_STAT_WORKAROUND(stat_area);
+ DBUG_RETURN(stat_area);
+ }
#else
- if (! my_win_stat(path, stat_area) )
- DBUG_RETURN(stat_area);
+ if (!my_win_stat(path, stat_area))
+ DBUG_RETURN(stat_area);
#endif
DBUG_PRINT("error",("Got errno: %d from stat", errno));
my_errno= errno;