libalpm/trans.c : exit the forked process correctly in case of errors.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
This commit is contained in:
Chantry Xavier 2007-07-07 17:11:18 +02:00 committed by Dan McGee
parent 8f2575b26e
commit 57d77eab32

View file

@ -639,11 +639,11 @@ int _alpm_runscriptlet(const char *root, const char *installfn,
_alpm_log(PM_LOG_DEBUG, _("chrooting in %s"), root); _alpm_log(PM_LOG_DEBUG, _("chrooting in %s"), root);
if(chroot(root) != 0) { if(chroot(root) != 0) {
_alpm_log(PM_LOG_ERROR, _("could not change the root directory (%s)"), strerror(errno)); _alpm_log(PM_LOG_ERROR, _("could not change the root directory (%s)"), strerror(errno));
return(1); exit(1);
} }
if(chdir("/") != 0) { if(chdir("/") != 0) {
_alpm_log(PM_LOG_ERROR, _("could not change directory to / (%s)"), strerror(errno)); _alpm_log(PM_LOG_ERROR, _("could not change directory to / (%s)"), strerror(errno));
return(1); exit(1);
} }
umask(0022); umask(0022);
_alpm_log(PM_LOG_DEBUG, _("executing \"%s\""), cmdline); _alpm_log(PM_LOG_DEBUG, _("executing \"%s\""), cmdline);