stat-util: add new macros for declaring statx variable

Let's deal with the msan initialization issue once for all cases instead
of over and over again.
This commit is contained in:
Lennart Poettering
2020-09-03 15:02:16 +02:00
parent 86e443de2f
commit 7cd296c28f
4 changed files with 26 additions and 34 deletions
+2 -13
View File
@@ -544,12 +544,7 @@ static int dir_cleanup(
* file systems such as overlayfs better where each file is originating from a
* different st_dev. */
struct statx sx
#if HAS_FEATURE_MEMORY_SANITIZER
= {}
# warning "Explicitly initializing struct statx, to work around msan limitation. Please remove as soon as msan has been updated to not require this."
#endif
;
STRUCT_STATX_DEFINE(sx);
if (statx(dirfd(d), dent->d_name,
AT_SYMLINK_NOFOLLOW|AT_NO_AUTOMOUNT,
@@ -2293,17 +2288,11 @@ static int clean_item_instance(Item *i, const char* instance) {
_cleanup_closedir_ DIR *d = NULL;
uint32_t dev_major, dev_minor;
nsec_t atime_nsec, mtime_nsec;
STRUCT_STATX_DEFINE(sx);
int mountpoint = -1;
usec_t cutoff, n;
uint64_t ino;
struct statx sx
#if HAS_FEATURE_MEMORY_SANITIZER
= {}
# warning "Explicitly initializing struct statx, to work around msan limitation. Please remove as soon as msan has been updated to not require this."
#endif
;
assert(i);
if (!i->age_set)