Fix static analysis issue 43/283043/1
authorSangyoon Jang <jeremy.jang@samsung.com>
Mon, 17 Oct 2022 06:23:23 +0000 (15:23 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Mon, 17 Oct 2022 06:23:23 +0000 (15:23 +0900)
Change-Id: I3906d8190357be171671f6aa47683068c7179c73
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
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) {