Remove unused variable 07/310807/1 tizen
authorIlho Kim <ilho159.kim@samsung.com>
Wed, 8 May 2024 10:21:24 +0000 (19:21 +0900)
committerIlho Kim <ilho159.kim@samsung.com>
Wed, 8 May 2024 10:21:24 +0000 (19:21 +0900)
Change-Id: Icf593aed636cc0aafd8932c0a77622b9f9adf5a6
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
packaging/pkgmgr-info.spec
src/server/database/abstract_db_handler.cc
src/server/database/db_handle_provider.cc

index 2541cee..8f8d1de 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       pkgmgr-info
 Summary:    Packager Manager infomation api for package
-Version:    0.26.7
+Version:    0.26.10
 Release:    1
 Group:      Application Framework/Package Management
 License:    Apache-2.0
index 7e829a3..b174ef0 100644 (file)
@@ -46,8 +46,6 @@ static void CheckDbLock(const std::string& dbpath) {
   unsigned int maj;
   unsigned int min;
   unsigned long long ino;
-  char cmdline[BUFSIZE];
-  char name[BUFSIZE];
   char type[1024];
 
   if (stat(dbpath.c_str(), &sb) == -1) {
@@ -67,22 +65,7 @@ static void CheckDbLock(const std::string& dbpath) {
         ino != sb.st_ino || pid == getpid())
       continue;
 
-    snprintf(cmdline, sizeof(cmdline), "/proc/%d/cmdline", pid);
-    FILE* fp_cmdline = fopen(cmdline, "r");
-    name[0] = '\0';
-    if (fp_cmdline != NULL) {
-      size_t len = fread(name, sizeof(char), sizeof(name) - 1,
-          fp_cmdline);
-      if (len > 0) {
-        if (name[len - 1] == '\n')
-          name[len - 1] = '\0';
-        else
-          name[len] = '\0';
-      }
-      fclose(fp_cmdline);
-    }
-
-    LOG(WARNING) << name << "(" << pid << ")" << "has lock("
+    LOG(WARNING) << "(" << pid << ")" << "has lock ("
         << type << ") on pkgmgr db(" << dbpath << ")";
   }
 
index 83a64fe..53c8e39 100644 (file)
@@ -508,14 +508,12 @@ void DBHandleProvider::UpdateCrashedWriterPackageInfo(
     uid_t uid, const std::string& locale,
     const std::unordered_set<pid_t>& pids) {
   std::vector<std::string> pkgids;
-  for (auto it = pending_pkg_.begin(); it != pending_pkg_.end();) {
-    pid_t pid = it->second;
-    if (pids.find(pid) == pids.end()) {
-      it++;
+  for (const auto& [pkgid, pid] : pending_pkg_) {
+    if (pids.find(pid) == pids.end())
       continue;
-    }
 
-    pkgids.emplace_back(it->first);
+    EraseWriterPID(pid);
+    pkgids.emplace_back(pkgid);
   }
 
   UpdatePendingPackageInfo(db, uid, locale, pkgids);