projects
/
project
/
procd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
preinit: define _GNU_SOURCE
[project/procd.git]
/
initd
/
zram.c
diff --git
a/initd/zram.c
b/initd/zram.c
index
49480af
..
0e78195
100644
(file)
--- a/
initd/zram.c
+++ b/
initd/zram.c
@@
-53,9
+53,9
@@
static int
early_insmod(char *module)
{
pid_t pid = fork();
early_insmod(char *module)
{
pid_t pid = fork();
+ char *modprobe[] = { "/sbin/modprobe", NULL, NULL };
if (!pid) {
if (!pid) {
- char *modprobe[] = { "/usr/sbin/modprobe", NULL, NULL };
char *path;
struct utsname ver;
char *path;
struct utsname ver;
@@
-64,12
+64,12
@@
early_insmod(char *module)
sprintf(path, module, ver.release);
modprobe[1] = path;
execvp(modprobe[0], modprobe);
sprintf(path, module, ver.release);
modprobe[1] = path;
execvp(modprobe[0], modprobe);
- ERROR("Can't exec
/usr/sbin/modprobe\n"
);
+ ERROR("Can't exec
%s\n", modprobe[0]
);
exit(-1);
}
if (pid <= 0) {
exit(-1);
}
if (pid <= 0) {
- ERROR("Can't exec
/usr/sbin/modprobe\n"
);
+ ERROR("Can't exec
%s\n", modprobe[0]
);
return -1;
} else {
waitpid(pid, NULL, 0);
return -1;
} else {
waitpid(pid, NULL, 0);
@@
-107,10
+107,10
@@
mount_zram_on_tmp(void)
pid = fork();
if (!pid) {
execvp(mkfs[0], mkfs);
pid = fork();
if (!pid) {
execvp(mkfs[0], mkfs);
- ERROR("Can't exec
/sbin/mkfs.ext4\n"
);
+ ERROR("Can't exec
%s\n", mkfs[0]
);
exit(-1);
} else if (pid <= 0) {
exit(-1);
} else if (pid <= 0) {
- ERROR("Can't exec
/sbin/mkfs.ext4\n"
);
+ ERROR("Can't exec
%s\n", mkfs[0]
);
return -1;
} else {
waitpid(pid, NULL, 0);
return -1;
} else {
waitpid(pid, NULL, 0);
@@
-124,5
+124,11
@@
mount_zram_on_tmp(void)
LOG("Using up to %ld kB of RAM as ZRAM storage on /mnt\n", zramsize);
LOG("Using up to %ld kB of RAM as ZRAM storage on /mnt\n", zramsize);
+ ret = chmod("/tmp", 01777);
+ if (ret < 0) {
+ ERROR("Can't set /tmp mode to 1777: %s\n", strerror(errno));
+ return errno;
+ }
+
return 0;
}
return 0;
}