vircgroupmock: Make global variables static

Apparently clang was fixed as it no longer considers having
global variables static a problem. Make the variables static to
be sure they aren't used outside of the source file.

This effectively reverts v1.0.6-rc1~198 which started the trend.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2022-03-03 16:23:48 +01:00
parent 61a12ffe08
commit c3c1293984

View File

@ -36,14 +36,10 @@ static FILE *(*real_fopen)(const char *path, const char *mode);
static int (*real_access)(const char *path, int mode);
static int (*real_mkdir)(const char *path, mode_t mode);
/* Don't make static, since it causes problems with clang
* when passed as an arg to asprintf()
* vircgroupmock.c:462:22: error: static variable 'fakesysfsdir' is used in an inline function with external linkage [-Werror,-Wstatic-in-inline]
*/
char *fakerootdir;
char *fakesysfscgroupdir;
const char *fakedevicedir0 = FAKEDEVDIR0;
const char *fakedevicedir1 = FAKEDEVDIR1;
static char *fakerootdir;
static char *fakesysfscgroupdir;
static const char *fakedevicedir0 = FAKEDEVDIR0;
static const char *fakedevicedir1 = FAKEDEVDIR1;
# define SYSFS_CGROUP_PREFIX "/not/really/sys/fs/cgroup"