mirror of
https://github.com/troglobit/finit.git
synced 2026-11-06 15:51:03 +00:00
Merge pull request #199 from liuming50/drop-c++-key-word
Avoid using C++ key words
This commit is contained in:
3 files changed
+8
-8
No files matched your search
+4
-4
@@ -42,7 +42,7 @@ struct cg {
|
|||||||
char *cfg; /* kernel settings */
|
char *cfg; /* kernel settings */
|
||||||
|
|
||||||
int active; /* for mark & sweep */
|
int active; /* for mark & sweep */
|
||||||
int protected; /* for init/, user/, & system/ */
|
int is_protected; /* for init/, user/, & system/ */
|
||||||
};
|
};
|
||||||
|
|
||||||
static TAILQ_HEAD(, cg) cgroups = TAILQ_HEAD_INITIALIZER(cgroups);
|
static TAILQ_HEAD(, cg) cgroups = TAILQ_HEAD_INITIALIZER(cgroups);
|
||||||
@@ -303,7 +303,7 @@ void cgroup_mark_all(void)
|
|||||||
struct cg *cg;
|
struct cg *cg;
|
||||||
|
|
||||||
TAILQ_FOREACH(cg, &cgroups, link) {
|
TAILQ_FOREACH(cg, &cgroups, link) {
|
||||||
if (cg->protected)
|
if (cg->is_protected)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
cg->active = 0;
|
cg->active = 0;
|
||||||
@@ -330,7 +330,7 @@ void cgroup_cleanup(void)
|
|||||||
/*
|
/*
|
||||||
* Add, or update, settings for top-level cgroup
|
* Add, or update, settings for top-level cgroup
|
||||||
*/
|
*/
|
||||||
int cgroup_add(char *name, char *cfg, int protected)
|
int cgroup_add(char *name, char *cfg, int is_protected)
|
||||||
{
|
{
|
||||||
struct cg *cg;
|
struct cg *cg;
|
||||||
|
|
||||||
@@ -364,7 +364,7 @@ int cgroup_add(char *name, char *cfg, int protected)
|
|||||||
free(cg);
|
free(cg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
cg->protected = protected;
|
cg->is_protected = is_protected;
|
||||||
cg->active = 1;
|
cg->active = 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ struct cgroup {
|
|||||||
void cgroup_mark_all(void);
|
void cgroup_mark_all(void);
|
||||||
void cgroup_cleanup (void);
|
void cgroup_cleanup (void);
|
||||||
|
|
||||||
int cgroup_add (char *name, char *cfg, int protected);
|
int cgroup_add (char *name, char *cfg, int is_protected);
|
||||||
int cgroup_del (char *dir);
|
int cgroup_del (char *dir);
|
||||||
void cgroup_config (void);
|
void cgroup_config (void);
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -36,7 +36,7 @@
|
|||||||
static int is_protected(char *dir)
|
static int is_protected(char *dir)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
char *protected[] = {
|
char *protected_mnts[] = {
|
||||||
"/sys", "/proc",
|
"/sys", "/proc",
|
||||||
"/.dev", "/dev", "/dev/pts", "/dev/shm", "dev/.static/dev", "/dev/vcs",
|
"/.dev", "/dev", "/dev/pts", "/dev/shm", "dev/.static/dev", "/dev/vcs",
|
||||||
"/run", "/var/run",
|
"/run", "/var/run",
|
||||||
@@ -46,8 +46,8 @@ static int is_protected(char *dir)
|
|||||||
"/proc/", "/sys/", "/run/", NULL
|
"/proc/", "/sys/", "/run/", NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
for (i = 0; protected[i]; i++) {
|
for (i = 0; protected_mnts[i]; i++) {
|
||||||
if (!strcmp(dir, protected[i]))
|
if (!strcmp(dir, protected_mnts[i]))
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user