X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fprocd.git;a=blobdiff_plain;f=initd%2Fpreinit.c;h=729978ea2f2af790653baaee5ae788f05a88a177;hp=51fde31a5c351c4745ded5499d1175eb95b81b41;hb=4004b68fe57dd72197b8a00b0756cc7f978ad88a;hpb=a1a1d1c6cf0ae302f76bc39a3d83aba66aee3228 diff --git a/initd/preinit.c b/initd/preinit.c index 51fde31..729978e 100644 --- a/initd/preinit.c +++ b/initd/preinit.c @@ -89,6 +89,7 @@ preinit(void) { char *init[] = { "/bin/sh", "/etc/preinit", NULL }; char *plug[] = { "/sbin/procd", "-h", "/etc/hotplug-preinit.json", NULL }; + int fd; LOG("- preinit -\n"); @@ -106,7 +107,13 @@ preinit(void) uloop_process_add(&plugd_proc); setenv("PREINIT", "1", 1); - creat("/tmp/.preinit", 0600); + + fd = creat("/tmp/.preinit", 0600); + + if (fd < 0) + ERROR("Failed to create sentinel file\n"); + else + close(fd); preinit_proc.cb = spawn_procd; preinit_proc.pid = fork();