Avoid using C++ key words

"protected" is a C++ key word, replace it with "is_protected" avoid
compiling failures with C++ compiler.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
This commit is contained in:
Ming Liu committed 2021-08-29 10:35:08 +02:00
1 parent 522a06f864
commit 00b33fbd42
3 files changed
+8 -8

No files matched your search

+3 -3
View File
@@ -36,7 +36,7 @@
static int is_protected(char *dir)
{
size_t i;
char *protected[] = {
char *protected_mnts[] = {
"/sys", "/proc",
"/.dev", "/dev", "/dev/pts", "/dev/shm", "dev/.static/dev", "/dev/vcs",
"/run", "/var/run",
@@ -46,8 +46,8 @@ static int is_protected(char *dir)
"/proc/", "/sys/", "/run/", NULL
};
for (i = 0; protected[i]; i++) {
if (!strcmp(dir, protected[i]))
for (i = 0; protected_mnts[i]; i++) {
if (!strcmp(dir, protected_mnts[i]))
return 1;
}