diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-29 10:35:04 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-29 10:35:04 +0900 |
commit | 8f331da86bcb848ebee6f930317fdb1553c56851 (patch) | |
tree | 0b7a54a024c4750e7c090fc0cabb437c6536feb7 /gio | |
parent | ee76d85151bc8056d89b718db01aa90c216858d3 (diff) | |
download | glib-8f331da86bcb848ebee6f930317fdb1553c56851.tar.gz glib-8f331da86bcb848ebee6f930317fdb1553c56851.tar.bz2 glib-8f331da86bcb848ebee6f930317fdb1553c56851.zip |
Imported Upstream version 2.68.4upstream/2.68.4
Diffstat (limited to 'gio')
-rwxr-xr-x | gio/data-to-c.py | 2 | ||||
-rw-r--r-- | gio/glocalfile.c | 3 | ||||
-rw-r--r-- | gio/glocalfilemonitor.c | 2 | ||||
-rw-r--r-- | gio/gwin32appinfo.c | 7 | ||||
-rwxr-xr-x | gio/gwin32packageparser.c | 2 | ||||
-rw-r--r-- | gio/gwin32registrykey.c | 15 |
6 files changed, 20 insertions, 11 deletions
diff --git a/gio/data-to-c.py b/gio/data-to-c.py index d8854b417..1724f7dd1 100755 --- a/gio/data-to-c.py +++ b/gio/data-to-c.py @@ -10,7 +10,7 @@ with open(sys.argv[1], "rb") as f: b = [r"\x{:02x}".format(ord(c)) for c in in_data] out_data = 'const char {0}[] = "'.format(sys.argv[2]) -out_data += "".join(b) + '";' +out_data += "".join(b) + '";\n' with open(sys.argv[3], "w") as f: f.write(out_data) diff --git a/gio/glocalfile.c b/gio/glocalfile.c index d3d68eca9..51a94e51c 100644 --- a/gio/glocalfile.c +++ b/gio/glocalfile.c @@ -2068,6 +2068,7 @@ g_local_file_trash (GFile *file, (global_stat.st_mode & S_ISVTX) != 0) { trashdir = g_build_filename (globaldir, uid_str, NULL); + success = TRUE; if (g_lstat (trashdir, &trash_stat) == 0) { @@ -2077,12 +2078,14 @@ g_local_file_trash (GFile *file, /* Not a directory or not owned by user, ignore */ g_free (trashdir); trashdir = NULL; + success = FALSE; } } else if (g_mkdir (trashdir, 0700) == -1) { g_free (trashdir); trashdir = NULL; + success = FALSE; } } g_free (globaldir); diff --git a/gio/glocalfilemonitor.c b/gio/glocalfilemonitor.c index eccab231c..dc32fb660 100644 --- a/gio/glocalfilemonitor.c +++ b/gio/glocalfilemonitor.c @@ -555,8 +555,8 @@ g_file_monitor_source_dispatch (GSource *source, g_file_monitor_source_update_ready_time (fms); - g_clear_object (&instance); g_mutex_unlock (&fms->lock); + g_clear_object (&instance); /* We now have our list of events to deliver */ while ((event = g_queue_pop_head (&event_queue))) diff --git a/gio/gwin32appinfo.c b/gio/gwin32appinfo.c index 5403225e2..3468dfee0 100644 --- a/gio/gwin32appinfo.c +++ b/gio/gwin32appinfo.c @@ -1629,6 +1629,7 @@ process_uwp_verbs (GList *verbs, continue; } + acid = NULL; got_value = g_win32_registry_key_get_value_w (key, g_win32_registry_get_os_dirs_w (), TRUE, @@ -3634,6 +3635,7 @@ grab_registry_string (GWin32RegistryKey *handler_appkey, if (*destination != NULL) return; + value = NULL; if (g_win32_registry_key_get_value_w (handler_appkey, NULL, TRUE, @@ -3828,6 +3830,9 @@ update_registry_data (void) return; } +static void +watch_keys (void); + /* This function is called when any of our registry watchers detect * changes in the registry. */ @@ -3835,6 +3840,7 @@ static void keys_updated (GWin32RegistryKey *key, gpointer user_data) { + watch_keys (); /* Indicate the tree as not up-to-date, push a new job for the AppInfo thread */ g_atomic_int_inc (&gio_win32_appinfo_update_counter); /* We don't use the data pointer, but it must be non-NULL */ @@ -4029,7 +4035,6 @@ gio_win32_appinfo_init (gboolean do_wait) g_mutex_lock (&gio_win32_appinfo_mutex); while (g_atomic_int_get (&gio_win32_appinfo_update_counter) > 0) g_cond_wait (&gio_win32_appinfo_cond, &gio_win32_appinfo_mutex); - watch_keys (); g_mutex_unlock (&gio_win32_appinfo_mutex); } } diff --git a/gio/gwin32packageparser.c b/gio/gwin32packageparser.c index ad5302270..ee05bb1dd 100755 --- a/gio/gwin32packageparser.c +++ b/gio/gwin32packageparser.c @@ -390,7 +390,7 @@ g_win32_package_parser_enum_packages (GWin32PackageParserCallback callback, wcs_path = LoadedWindowsGetStringRawBuffer (path, NULL); manifest_filename_size = wcslen (wcs_path) + wcslen (bslash_appmanifest); manifest_filename = g_new (wchar_t, manifest_filename_size + 1); - memcpy (manifest_filename, wcs_path, manifest_filename_size * sizeof (wchar_t)); + memcpy (manifest_filename, wcs_path, wcslen (wcs_path) * sizeof (wchar_t)); memcpy (&manifest_filename[wcslen (wcs_path)], bslash_appmanifest, (wcslen (bslash_appmanifest) + 1) * sizeof (wchar_t)); memset (sax, 0, sizeof (*sax)); diff --git a/gio/gwin32registrykey.c b/gio/gwin32registrykey.c index 398d8f45b..5e2b006dd 100644 --- a/gio/gwin32registrykey.c +++ b/gio/gwin32registrykey.c @@ -2425,17 +2425,20 @@ key_changed (PVOID closure, ULONG reserved) { GWin32RegistryKey *key = G_WIN32_REGISTRY_KEY (closure); + gpointer user_data; + GWin32RegistryKeyWatchCallbackFunc callback; + + callback = g_steal_pointer (&key->priv->callback); + user_data = g_steal_pointer (&key->priv->user_data); g_free (status_block); g_atomic_int_set (&key->priv->change_indicator, G_WIN32_KEY_CHANGED); g_atomic_int_set (&key->priv->watch_indicator, G_WIN32_KEY_UNWATCHED); key->priv->update_flags = G_WIN32_REGISTRY_UPDATED_NOTHING; - if (key->priv->callback) - key->priv->callback (key, key->priv->user_data); + if (callback) + callback (key, user_data); - key->priv->callback = NULL; - key->priv->user_data = NULL; g_object_unref (key); } @@ -2550,9 +2553,7 @@ g_win32_registry_key_watch (GWin32RegistryKey *key, 0, TRUE); - g_assert (status != STATUS_SUCCESS); - - if (status == STATUS_PENDING) + if (status == STATUS_PENDING || status == STATUS_SUCCESS) return TRUE; g_atomic_int_set (&key->priv->change_indicator, G_WIN32_KEY_UNKNOWN); |