Fix static analysis issue
[platform/core/api/package-manager.git] / src / package_manager_internal.c
index ee0ccf9..326742b 100644 (file)
@@ -50,8 +50,8 @@ int check_privilege(privilege_type type)
        char uid[10];
        char *session;
        const char *privilege;
-       unsigned long pid = getpid();
-       unsigned long tid = gettid();
+       pid_t pid = getpid();
+       pid_t tid = gettid();
 
        if (pid == tid) {
                fd = open("/proc/self/attr/current", O_RDONLY);
@@ -59,7 +59,7 @@ int check_privilege(privilege_type type)
                // Check current thread smack label.
                char path[256] = { 0 };
                pid = tid;
-               snprintf(path, sizeof(path), "/proc/%lu/attr/current", tid);
+               snprintf(path, sizeof(path), "/proc/%d/attr/current", tid);
                fd = open(path, O_RDONLY);
        }
        if (fd < 0) {