From fd2a83d725de078335c90173f7c8d3a6e985be30 Mon Sep 17 00:00:00 2001 From: Anton Farygin Date: Fri, 10 Dec 2010 19:58:22 +0000 Subject: [PATCH] check /bin/plymouth before exec --- init.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/init.c b/init.c index e64a639..729b07d 100644 --- a/init.c +++ b/init.c @@ -344,7 +344,7 @@ void unmount_filesystems(void) int main(int argc, char **argv) { - struct stat rst, cst, ist; + struct stat rst, cst, ist, pst; struct statfs sfs; pid_t pid, klogpid, udevpid; sigset_t sig; @@ -516,9 +516,10 @@ int main(int argc, char **argv) /* First, change to the new root directory */ if (chdir(STAGE2_LOCATION)) fatal("chdir to new root"); - - char * plymouth[] = { "/bin/plymouth", "plymouth", "--newroot=/root", NULL }; - spawn(plymouth); + if (stat("/bin/plymouth", &pst) == 0 ) { + char * plymouth[] = { "/bin/plymouth", "plymouth", "--newroot=/root", NULL }; + spawn(plymouth); + } /* This is a potentially highly destructive program. Take some extra precautions. */