GError *error = NULL;
gchar *path = build_stream_name(FIFO, dir);
+ // This extra check is an alternative to recursively calling init_fifo() or using goto
+ if (file_exists(path)) {
+ if (unlink(path))
+ g_warning ("init_fifo: can't delete %s: %s", path, strerror(errno));
+ }
+
if (!file_exists(path)) {
if (mkfifo (path, 0666) == 0) {
// we don't really need to write to the file, but if we open the file as 'r' we will block here, waiting for a writer to open the file.
get_xdg_var (XDG_Var xdg) {
const gchar* actual_value = getenv (xdg.environmental);
const gchar* home = getenv ("HOME");
-
- gchar* return_value = str_replace ("~", home, actual_value);
+ gchar* return_value;
if (! actual_value || strcmp (actual_value, "") == 0) {
if (xdg.default_value) {
} else {
return_value = NULL;
}
+ } else {
+ return_value = str_replace("~", home, actual_value);
}
+
return return_value;
}
}
static gboolean
-inspector_dettach_window_cb (WebKitWebInspector* inspector){
+inspector_detach_window_cb (WebKitWebInspector* inspector){
(void) inspector;
return FALSE;
}
g_signal_connect (G_OBJECT (g->inspector), "show-window", G_CALLBACK (inspector_show_window_cb), NULL);
g_signal_connect (G_OBJECT (g->inspector), "close-window", G_CALLBACK (inspector_close_window_cb), NULL);
g_signal_connect (G_OBJECT (g->inspector), "attach-window", G_CALLBACK (inspector_attach_window_cb), NULL);
- g_signal_connect (G_OBJECT (g->inspector), "dettach-window", G_CALLBACK (inspector_dettach_window_cb), NULL);
- g_signal_connect (G_OBJECT (g->inspector), "destroy", G_CALLBACK (inspector_inspector_destroyed_cb), NULL);
+ g_signal_connect (G_OBJECT (g->inspector), "detach-window", G_CALLBACK (inspector_detach_window_cb), NULL);
+ g_signal_connect (G_OBJECT (g->inspector), "finished", G_CALLBACK (inspector_inspector_destroyed_cb), NULL);
g_signal_connect (G_OBJECT (g->inspector), "notify::inspected-uri", G_CALLBACK (inspector_uri_changed_cb), NULL);
}