upgrade-apply-deltafs: Fix missleading debug message in SS_Unlink() 22/286622/3 accepted/tizen/unified/20230116.060918
authorAntoni Adaszkiewicz <a.adaszkiewi@samsung.com>
Tue, 10 Jan 2023 12:32:45 +0000 (13:32 +0100)
committerAntoni Adaszkiewicz <a.adaszkiewi@samsung.com>
Tue, 10 Jan 2023 13:15:17 +0000 (14:15 +0100)
ENOENT is handled by upgrade-apply-deltafs, but previous debug
messages suggested that ENOENT was an error.

Change-Id: I272886ee2f66d4efb0ee64b13af018c98b6362a2

src/upgrade-apply-deltafs/engine/SS_FSUpdate.c

index 54ff21965b9d7538c5f0425f78235c647475e942..c87205d1e880a3c9c73d12c74b68169edcdad569 100755 (executable)
@@ -521,11 +521,15 @@ long SS_Unlink(char *pLinkName)
        SS_unicode_to_char((const char *)pLinkName, (char *)path, MAX_PATH - 1);
 
        ret = unlink(path);
-       if (ret < 0 && errno != ENOENT) {
-               LOGE("unlink failed with return value: %d\n", ret);
-               return E_SS_FAILURE;
+       if (ret < 0) {
+               if (errno != ENOENT) {
+                       LOGE("unlink failed with return value: %d\n", ret);
+                       return E_SS_FAILURE;
+               }
+               LOGL(LOG_SSENGINE, "unlink with return value: %d, but errno is ENOENT and is expected\n", ret);
+       } else {
+               LOGL(LOG_SSENGINE, "unlink with return value: %d\n", ret);
        }
-       LOGL(LOG_SSENGINE, "unlink with return value: %d\n", ret);
 
        return S_SS_SUCCESS;
 }