From f36aea3c4e00e9f3e3887d56d6be54af28724ad2 Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Fri, 18 Mar 2016 14:32:43 +0900 Subject: [PATCH] Handle error case on execl failed Change-Id: I02b91937306a44affb17cf7e7b404a08215dcf2b Signed-off-by: Sangyoon Jang --- src/pkg_initdb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pkg_initdb.c b/src/pkg_initdb.c index 558f7c3..9bc70c9 100644 --- a/src/pkg_initdb.c +++ b/src/pkg_initdb.c @@ -96,6 +96,8 @@ static int _initdb_load_directory(uid_t uid, const char *directory) execl(PKGINSTALLMANIFEST_CMD, PKGINSTALLMANIFEST_CMD, "-x", buf, (char *)NULL); + _E("failed to execute: %s", strerror_r(errno, buf, sizeof(buf))); + exit(EXIT_FAILURE); } else if (pid < 0) { _E("failed to fork and execute %s!", PKGINSTALLMANIFEST_CMD); closedir(dir); -- 2.7.4