pkg: rpm installation exit codes checking
authorJinhyung Choi <jinhyung2.choi@samsung.com>
Tue, 20 Jan 2015 05:50:56 +0000 (14:50 +0900)
committerJinhyung Choi <jinhyung2.choi@samsung.com>
Tue, 20 Jan 2015 05:50:56 +0000 (14:50 +0900)
Change-Id: I92ddc560a5deb54f9cd8e0f40d3c45855666c330
Signed-off-by: Jinhyung Choi <jinhyung2.choi@samsung.com>
packaging/emuld.spec
src/common.cpp

index a807af9910e2e0171c39caee6b86a1fe19a3bb9d..0c91149f87c8c108d99ac2bc580ff4e8f43f85e1 100644 (file)
@@ -1,5 +1,5 @@
 Name: emuld
-Version: 0.8.6
+Version: 0.8.7
 Release: 0
 Summary: Emulator daemon
 License: Apache-2.0
index d6413cbdac18c1abd3cb56d560be3dcd0de8ae31..becc17bac664ae13a6fe4553d2f95eeabfd0484c 100644 (file)
@@ -213,7 +213,7 @@ static bool do_validate(char* pkgs)
 static bool do_install(char* pkgs)
 {
     char buf[MAX_PKGS_BUF];
-    bool ret = true;
+    int ret = 0;
 
     FILE* fp = popen(pkgs, "r");
     if (fp == NULL) {
@@ -224,16 +224,17 @@ static bool do_install(char* pkgs)
     memset(buf, 0, sizeof(buf));
     while(fgets(buf, sizeof(buf), fp)) {
         LOGINFO("[rpm] %s", buf);
-
-        if (!strncmp(buf, "error", 5)) {
-            ret = false;
-        }
         memset(buf, 0, sizeof(buf));
     }
 
-    pclose(fp);
+    ret = pclose(fp);
+    LOGINFO("[rpm] return value: %d", ret);
 
-    return ret;
+    if (ret != 0) {
+        return false;
+    }
+
+    return true;
 }
 
 static void remove_package(char* data)