summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorhwspeedy <ns@bigbear.dk>2024-02-28 08:05:34 +0100
committerhwspeedy <ns@bigbear.dk>2024-02-28 08:05:34 +0100
commit32e5f4bfe548ebe15c07a4144bc86e09a5305cec (patch)
tree26d3e4322c6805db1c6e34f91eb6b80a6f2f47f5 /shell
parentd7b80385dea105d99b0e3666bce87c68b5511b54 (diff)
FIX sync for newly distributed app to use supplied blobver
Diffstat (limited to 'shell')
-rw-r--r--shell/syncmanager.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/shell/syncmanager.c b/shell/syncmanager.c
index 72f3255c..436509f4 100644
--- a/shell/syncmanager.c
+++ b/shell/syncmanager.c
@@ -218,17 +218,23 @@ static void sync_dialog_start_sync(SyncDialog *sd)
gint nactions;
SyncNetAction *actions;
gchar *path;
- int fd,len;
+ int fd=-1,len;
gchar buf[101];
path = g_build_filename(g_get_user_config_dir(), "hardinfo2",
"blobs-update-version.json", NULL);
fd = open(path,O_RDONLY);
- if(fd){
+ if(fd<0) {
+ free(path);
+ path = g_build_filename(params.path_data,"blobs-update-version.json", NULL);
+ fd = open(path,O_RDONLY);
+ }
+ if(fd>=0){
read(fd,buf,100);
sscanf(buf,"{\"update-version\":\"%u\",",&our_blobs_update_version);
close(fd);
}
+ free(path);
DEBUG("OUR2_BLOBS_UPDATE_VERSION=%u",our_blobs_update_version);
ensure_soup_session();
@@ -739,16 +745,22 @@ void sync_manager_update_on_startup(void)
{
GSList *entry;
gchar *path;
- int fd;
+ int fd=-1;
gchar buf[101];
path = g_build_filename(g_get_user_config_dir(), "hardinfo2",
"blobs-update-version.json", NULL);
fd = open(path,O_RDONLY);
- if(fd){
+ if(fd<0) {
+ free(path);
+ path = g_build_filename(params.path_data,"blobs-update-version.json", NULL);
+ fd = open(path,O_RDONLY);
+ }
+ if(fd>=0){
read(fd,buf,100);
sscanf(buf,"{\"update-version\":\"%u\",",&our_blobs_update_version);
close(fd);
}
+ free(path);
DEBUG("OUR1_BLOBS_UPDATE_VERSION=%u",our_blobs_update_version);
ensure_soup_session();