[PATCH 2/4] vircgroupmock: Make global variables static

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 tests/vircgroupmock.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/tests/vircgroupmock.c b/tests/vircgroupmock.c
index cbf5269df6..a213c8e686 100644
--- a/tests/vircgroupmock.c
+++ b/tests/vircgroupmock.c
@@ -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"
-- 
2.34.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux