diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c index 628d99ac5a..6d1796c315 100644 --- a/src/basic/stat-util.c +++ b/src/basic/stat-util.c @@ -471,6 +471,8 @@ int path_is_network_fs(const char *path) { } int proc_mounted(void) { + /* This is typically used in error path. So, it is better to not overwrite the original errno. */ + PROTECT_ERRNO; int r; /* A quick check of procfs is properly mounted */