Fix various problems with unchecked return values from syscalls.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2014-11-27 00:12:07 +01:00
parent def759fe41
commit 02a97e8d7d
10 changed files with 25 additions and 16 deletions
+3 -4
View File
@@ -57,7 +57,6 @@ static void setup(void *UNUSED(arg))
_d("Setting up necessary UTMP files ...");
touch("/var/run/utmp");
chown("/var/run/utmp", 0, getgroup("utmp"));
chmod("/var/run/utmp", 0664);
#ifdef RUNLEVEL
memset(&entry, 0, sizeof(struct utmp));
@@ -71,7 +70,7 @@ static void setup(void *UNUSED(arg))
#ifdef TOUCH_ETC_NETWORK_RUN_IFSTATE
touch("/etc/network/run/ifstate");
#else
remove("/etc/network/run/ifstate");
erase("/etc/network/run/ifstate");
#endif
_d("Setting up misc files ...");
@@ -79,8 +78,8 @@ static void setup(void *UNUSED(arg))
makedir("/var/run/pluto", 0755); /* Needed by Openswan */
makedir("/var/run/quagga", 0755); /* Needed by Quagga */
makedir("/var/log/quagga", 0755); /* Needed by Quagga */
makedir("/var/run/sshd", 01755); /* OpenSSH */
mkfifo("/dev/xconsole", 0640); /* sysklogd */
makedir("/var/run/sshd", 01755); /* OpenSSH */
makefifo("/dev/xconsole", 0640); /* sysklogd */
chown("/dev/xconsole", 0, getgroup("tty"));
}
+1 -1
View File
@@ -32,7 +32,7 @@ static void setup(void *UNUSED(arg))
makedir("/var/run/dbus", 0755);
makedir("/var/lock/subsys/messagebus", 0755);
run("dbus-uuidgen --ensure");
remove("/var/run/dbus/pid");
erase("/var/run/dbus/pid");
run_interactive("dbus-daemon --system", "Starting D-Bus");
#endif
}
+1 -1
View File
@@ -124,7 +124,7 @@ static void parse(void *UNUSED(arg), int fd, int UNUSED(events))
PLUGIN_INIT(plugin_init)
{
_d("Setting up %s", FINIT_FIFO);
mkfifo(FINIT_FIFO, 0600);
makefifo(FINIT_FIFO, 0600);
fifo_open();
plugin_register(&plugin);
+1 -1
View File
@@ -36,7 +36,7 @@ static void setup(void *UNUSED(arg))
#endif
char line[LINE_SIZE];
makepath("/var/run/console");
makedir("/var/run/console", 01777);
snprintf(line, sizeof(line), "/var/run/console/%s", username);
touch(line);