#include <unistd.h>
#include <sys/stat.h>
#include <dirent.h>
+#include <stdio.h>
#include <connman/storage.h>
#define SETTINGS "settings"
#define DEFAULT "default.profile"
+#if defined TIZEN_EXT && defined TIZEN_EXT_INS
+#define INS_SETTINGS "settings.ins"
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_INS */
#define MODE (S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | \
S_IXGRP | S_IROTH | S_IXOTH)
ret = -EIO;
}
+#if defined TIZEN_EXT
+ {
+ FILE *fp = NULL;
+ fp = fopen(pathname, "a+");
+ if(fp){
+ fflush(fp);
+ fsync(fp->_fileno);
+ fclose(fp);
+ DBG("sync the file to disk");
+ }
+ }
+#endif
+
g_free(data);
return ret;
return ret;
}
+#if defined TIZEN_EXT && defined TIZEN_EXT_INS
+GKeyFile *__connman_storage_load_ins(void)
+{
+ gchar *pathname;
+ GKeyFile *keyfile = NULL;
+
+ pathname = g_strdup_printf("%s/%s", STORAGEDIR, INS_SETTINGS);
+ if (!pathname)
+ return NULL;
+
+ keyfile = storage_load(pathname);
+
+ g_free(pathname);
+
+ return keyfile;
+}
+
+int __connman_storage_save_ins(GKeyFile *keyfile)
+{
+ gchar *pathname;
+ int ret;
+
+ pathname = g_strdup_printf("%s/%s", STORAGEDIR, INS_SETTINGS);
+ if (!pathname)
+ return -ENOMEM;
+
+ ret = storage_save(keyfile, pathname);
+
+ g_free(pathname);
+
+ return ret;
+}
+#endif /* defined TIZEN_EXT && defined TIZEN_EXT_INS */
+
void __connman_storage_delete_global(void)
{
gchar *pathname;