summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Lynch <rusty.lynch@intel.com>2013-10-10 15:19:55 -0700
committerRusty Lynch <rusty.lynch@intel.com>2013-10-10 15:38:05 -0700
commit5cdc2874cdc9b3cdcdb2289330403f192fcdfae0 (patch)
tree9a33dde7ac246187d2845f94a7a33a15560b892f
parent0c9b80463d2b7002d3122c9a3c7fcde98f6d2ad8 (diff)
downloadvconf-tizen_ivi_genivi.tar.gz
vconf-tizen_ivi_genivi.tar.bz2
vconf-tizen_ivi_genivi.zip
The vconf code has a left over, racey and broken, workaround to have all vconf set operations attempt to wait for a file called /tmp/vconf-initialized. If a set for an in-memory key was attempted when the file did not exist, then after nearly two seconds of trying the end result is the backup key file was created, but containing no data. Because of this, and because vconf initialization does not happen at image creation time, then all images are created with many in-memory backup items containing empty files. This results in many subtle hard to debug bugs throughout the stack. Change-Id: I3f9a4e1aa0f8267ccc07631c0eae2e2315ab2d17 Signed-off-by: Rusty Lynch <rusty.lynch@intel.com>
-rwxr-xr-xpackaging/vconf.spec1
-rwxr-xr-xvconf-init1
-rwxr-xr-xvconf.c27
3 files changed, 2 insertions, 27 deletions
diff --git a/packaging/vconf.spec b/packaging/vconf.spec
index 7dd6f25..6631f40 100755
--- a/packaging/vconf.spec
+++ b/packaging/vconf.spec
@@ -57,7 +57,6 @@ install -m0644 %SOURCE2 %{buildroot}%{_prefix}/lib/tmpfiles.d/
ln -sf ../vconf-setup.service %{buildroot}%{_unitdir}/basic.target.wants/
%post
-touch /tmp/vconf-initialized
/sbin/ldconfig
systemctl daemon-reload
diff --git a/vconf-init b/vconf-init
index fe3f07d..c3304e9 100755
--- a/vconf-init
+++ b/vconf-init
@@ -7,4 +7,3 @@ set -e
cp -a /opt/var/kdb/memory_init/memory/* /var/run/memory
-touch /tmp/vconf-initialized
diff --git a/vconf.c b/vconf.c
index 45ebd15..f7eee54 100755
--- a/vconf.c
+++ b/vconf.c
@@ -37,8 +37,6 @@
#define VCONF_ERROR_RETRY_CNT 20
#define VCONF_ERROR_RETRY_SLEEP_UTIME 10000
-#define VCONF_NOT_INITIALIZED (access("/tmp/vconf-initialized", F_OK) == -1)
-
#ifdef VCONF_USE_SQLFS_TRANSACTION
int IN_SBOX=0;
@@ -1037,11 +1035,6 @@ static int _vconf_set_key_filesys(keynode_t *keynode, int prefix)
ret = _vconf_get_key_path(keynode->keyname, path);
retv_if(ret != VCONF_OK, ret);
- if(prefix == VCONF_BACKEND_MEMORY && VCONF_NOT_INITIALIZED) {
- func_ret = VCONF_ERROR_NOT_INITIALIZED;
- goto out_return;
- }
-
#ifdef VCONF_USE_BACKUP_TRANSACTION
if(prefix == VCONF_BACKEND_DB && keynode->type == VCONF_TYPE_STRING) {
_vconf_get_backup_path(keynode->keyname, backup_path);
@@ -1216,12 +1209,7 @@ static int _vconf_set_key(keynode_t *keynode)
is_busy_err = 0;
retry++;
- if(VCONF_NOT_INITIALIZED)
- {
- ERR("%s : vconf is not initialized\n", keynode->keyname);
- is_busy_err = 1;
- }
- else if(ret == VCONF_ERROR_FILE_OPEN)
+ if(ret == VCONF_ERROR_FILE_OPEN)
{
switch (errno)
{
@@ -1712,12 +1700,6 @@ static int _vconf_get_key_filesys(keynode_t *keynode, int prefix)
ret = _vconf_get_key_path(keynode->keyname, path);
retv_if(ret != VCONF_OK, ret);
- if(prefix == VCONF_BACKEND_MEMORY && VCONF_NOT_INITIALIZED)
- {
- func_ret = VCONF_ERROR_NOT_INITIALIZED;
- goto out_return;
- }
-
#ifdef VCONF_USE_BACKUP_TRANSACTION
if(prefix == VCONF_BACKEND_DB) {
_vconf_get_backup_path(keynode->keyname, backup_path);
@@ -1912,12 +1894,7 @@ int _vconf_get_key(keynode_t *keynode)
is_busy_err = 0;
retry++;
- if(VCONF_NOT_INITIALIZED)
- {
- ERR("%s : vconf is not initialized\n", keynode->keyname);
- is_busy_err = 1;
- }
- else if(ret == VCONF_ERROR_FILE_OPEN)
+ if(ret == VCONF_ERROR_FILE_OPEN)
{
switch (errno)
{