summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2020-12-01 02:37:24 +0300
committerEvgeny Zinoviev <me@ch1p.io>2020-12-01 02:37:24 +0300
commit1dffdb97be4457e8cad905aa910677be81057fe3 (patch)
treec47bdc7d91739153550f3f5e3c3712643b9172dc
parent5aae9ea419dff746b2622abf76e0c6f25ab17f63 (diff)
fix indentation
-rw-r--r--voidnsrun.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/voidnsrun.c b/voidnsrun.c
index 56ff561..b1a34b3 100644
--- a/voidnsrun.c
+++ b/voidnsrun.c
@@ -78,20 +78,20 @@ bool mountlist(
bool isxbpscommand(const char *s)
{
- const char *commands[] = {
- "/xbps-install",
- "/xbps-remove",
- "/xbps-reconfigure"
- };
- for (size_t i = 0; i < ARRAY_SIZE(commands); i++) {
- const char *command = commands[i];
- if (!strcmp(s, command+1))
- return true;
- char *slash = strrchr(s, '/');
- if (slash && !strcmp(slash, command))
- return true;
- }
- return false;
+ const char *commands[] = {
+ "/xbps-install",
+ "/xbps-remove",
+ "/xbps-reconfigure"
+ };
+ for (size_t i = 0; i < ARRAY_SIZE(commands); i++) {
+ const char *command = commands[i];
+ if (!strcmp(s, command+1))
+ return true;
+ char *slash = strrchr(s, '/');
+ if (slash && !strcmp(slash, command))
+ return true;
+ }
+ return false;
}
int main(int argc, char **argv)
@@ -100,7 +100,7 @@ int main(int argc, char **argv)
usage(argv[0]);
return 0;
}
-
+
int result;
char *dir = NULL;
size_t dirlen;
@@ -145,7 +145,7 @@ int main(int argc, char **argv)
ERROR("error: %s is not a directory.\n", dir);
return 1;
}
-
+
dirlen = strlen(dir);
/* Do the unshare magic. */
@@ -158,16 +158,16 @@ int main(int argc, char **argv)
/* Mount stuff from altroot to our private namespace. */
const char *mountpoints[3] = {"/usr", NULL, NULL};
if (isxbpscommand(argv[optind])) {
- mountpoints[1] = "/var";
- mountpoints[2] = "/etc";
+ mountpoints[1] = "/var";
+ mountpoints[2] = "/etc";
} else {
- mountpoints[1] = "/var/db/xbps";
- mountpoints[2] = "/etc/xbps.d";
+ mountpoints[1] = "/var/db/xbps";
+ mountpoints[2] = "/etc/xbps.d";
}
if (!mountlist(dir, dirlen, mountpoints, ARRAY_SIZE(mountpoints), true))
return 1;
if (usermounts_num > 0 &&
- !mountlist(dir, dirlen, usermounts, usermounts_num, false))
+ !mountlist(dir, dirlen, usermounts, usermounts_num, false))
return 1;
/* Drop root. */