mount: restorecon: guard against execl() errors
[project/fstools.git] / libfstools / mount.c
index b30e5a6d3846639a0522867b5285478a48e2a916..1691ce747f50921423e1ca43709549c612b6d1be 100644 (file)
@@ -99,7 +99,7 @@ selinux_restorecon(char *overlaydir)
 
        restorecon_pid = fork();
        if (!restorecon_pid)
-               execl("/sbin/restorecon", "restorecon", overlaydir, (char *) NULL);
+               exit(execl("/sbin/restorecon", "restorecon", overlaydir, (char *) NULL));
        else if (restorecon_pid > 0)
                waitpid(restorecon_pid, &status, 0);
 }