From: junsuk77.oh Date: Fri, 12 Apr 2013 09:28:33 +0000 (+0900) Subject: rollback parser child process X-Git-Tag: 2.1b_release~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=48c94e96e19f68118553d8a24424cf170aa01a0d;p=framework%2Fappfw%2Fpkgmgr-info.git rollback parser child process Change-Id: I3412e10631aca3f19db15f1719e5ee384956e43a Signed-off-by: junsuk77.oh --- diff --git a/packaging/pkgmgr-info.spec b/packaging/pkgmgr-info.spec index 4433883..a85037a 100755 --- a/packaging/pkgmgr-info.spec +++ b/packaging/pkgmgr-info.spec @@ -1,6 +1,6 @@ Name: pkgmgr-info Summary: Packager Manager infomation api for package -Version: 0.0.99 +Version: 0.0.100 Release: 1 Group: Application Framework/Package Management License: Apache-2.0 diff --git a/parser/pkgmgr_parser.c b/parser/pkgmgr_parser.c index f89917d..0b24766 100755 --- a/parser/pkgmgr_parser.c +++ b/parser/pkgmgr_parser.c @@ -277,9 +277,6 @@ static int __ps_run_parser(xmlDocPtr docPtr, const char *tag, int (*plugin_install) (xmlDocPtr, const char *); int ret = -1; char *ac = NULL; - int cpid = -1; - int status = 0; - int w = 0; switch (action) { case ACTION_INSTALL: @@ -299,50 +296,24 @@ static int __ps_run_parser(xmlDocPtr docPtr, const char *tag, if (!lib_path) { goto END; } - /*fork a child*/ - cpid = fork(); - switch (cpid) { - case -1: - DBGE("fork() failed\n"); + + if ((lib_handle = dlopen(lib_path, RTLD_LAZY)) == NULL) { + DBGE("dlopen is failed lib_path[%s]\n", lib_path); + goto END; + } + if ((plugin_install = + dlsym(lib_handle, ac)) == NULL || dlerror() != NULL) { + DBGE("can not find symbol \n"); goto END; - case 0: - /*child process*/ - if ((lib_handle = dlopen(lib_path, RTLD_LAZY)) == NULL) { - DBGE("dlopen is failed lib_path[%s]\n", lib_path); - exit(-1); - } - if ((plugin_install = - dlsym(lib_handle, ac)) == NULL || dlerror() != NULL) { - DBGE("can not find symbol \n"); - if (lib_handle) - dlclose(lib_handle); - exit(-1); - } - ret = plugin_install(docPtr, pkgid); - if (lib_handle) - dlclose(lib_handle); - exit(ret); - default: - /*parent process*/ - do { - w = waitpid(cpid, &status, WUNTRACED | WCONTINUED); - if (w == -1) { - DBGE("waitpid() failed\n"); - break; - } - } while (!WIFEXITED(status) && !WIFSIGNALED(status)); - if (WIFEXITED(status)) - ret = WEXITSTATUS(status); - else if (WIFSIGNALED(status)) - ret = WTERMSIG(status); - else - ret = 0; - DBGE("Child exit status=%d\n", ret); - break; } + + ret = plugin_install(docPtr, pkgid); + END: if (lib_path) free(lib_path); + if (lib_handle) + dlclose(lib_handle); return ret; }