Remove fsync from init code 57/319457/2 accepted/tizen/9.0/unified/20250212.171248
authorJaehyun Kim <jeik01.kim@samsung.com>
Tue, 11 Feb 2025 08:20:25 +0000 (17:20 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Tue, 11 Feb 2025 09:05:44 +0000 (18:05 +0900)
In situations where the system is busy,
there are cases where delays occur due to the fsync code,
preventing requests from being processed in a timely manner.
To avoid this, the code has been removed.
Removing this code will not affect the STC operations.

Change-Id: I5e201d9506c5cd98808aad750349dcf121c04bd8
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
src/helper/helper-config.c

index 243201ae1db78a385a39e23617901965cd738cfd..ac8f7f6dbdf2e37acd1e33138f7307ddc75c6fd4 100755 (executable)
@@ -46,7 +46,6 @@ static int __save_config_file(GKeyFile *keyfile, char *path)
        gsize length = 0;
        GError *error = NULL;
        int ret = 0;
-       FILE *fp = NULL;
 
        data = g_key_file_to_data(keyfile, &length, NULL);
        if (!g_file_set_contents(path, data, length, &error)) {
@@ -55,14 +54,6 @@ static int __save_config_file(GKeyFile *keyfile, char *path)
                ret = -EIO;
        }
 
-       fp = fopen(path, "a+");
-       if (fp) {
-               fflush(fp);
-               fsync(fp->_fileno);
-               fclose(fp);
-               STC_LOGD("Sync the file to disk");
-       }
-
        g_free(data);
        return ret;
 }