Fix errno bug issue 35/322335/1 accepted/tizen_unified accepted/tizen_unified_x tizen accepted/tizen/unified/20250409.082052 accepted/tizen/unified/x/20250409.212129
authorYoungHun Kim <yh8004.kim@samsung.com>
Mon, 7 Apr 2025 22:24:19 +0000 (07:24 +0900)
committerYoungHun Kim <yh8004.kim@samsung.com>
Mon, 7 Apr 2025 22:24:23 +0000 (07:24 +0900)
 - Set the value before dlog totally

Change-Id: I4bf4264d90d0fae3bbd521c9cd533bccf314159e

src/CCallback.cpp

index 33977df72ed21fac74a452c82d002efd5f51e497..40c86bb2e4df9cb7792bc66c18e138bb917485db 100644 (file)
@@ -62,14 +62,14 @@ int CCallback::SendCallbackMessage(int cid, int pid, void *callback_data, int si
        snprintf(callback_path, 256, "/run/rsc_mgr/%d.%d.s2c.cb", pid, cid);
 
        if ((fd = open(callback_path, O_WRONLY | O_NONBLOCK)) < 0) {
-               SERVER_ERR("open error (%s), errno(%d)", callback_path, errno);
                *err = errno;
+               SERVER_ERR("open error (%s), errno(%d)", callback_path, errno);
                return RMS_ERROR;
        }
 
        if (is_symlink_file(callback_path)) {
-               SERVER_ERR("%s is symbolic link file", callback_path);
                *err = EPERM;
+               SERVER_ERR("%s is symbolic link file", callback_path);
                close(fd);
                return RMS_ERROR;
        }
@@ -77,8 +77,8 @@ int CCallback::SendCallbackMessage(int cid, int pid, void *callback_data, int si
        ret = write(fd, callback_data, size);
 
        if (ret <= 0) {
-               SERVER_ERR("failed to write callback.(%s) ret(%d), errno(%d)", callback_path, ret, errno);
                *err = errno;
+               SERVER_ERR("failed to write callback.(%s) ret(%d), errno(%d)", callback_path, ret, errno);
                close(fd);
                return RMS_ERROR;
        }