Queues are tied to the PID of the process that wrote them. But
the app runs with the same PID in the sandbox on every invocation. So
the new pid file must be written after processing any previous queue.
(cherry picked from commit
9b44cc7808d3d1e185a0ed517ac7d485e92cca93)
ghb_override_user_config_dir(arg_config_dir);
}
- ghb_write_pid_file();
-
// map application actions (menu callbacks)
map_actions(app, ud);
if (strncmp(file, "ghb.pid.", 8) == 0)
{
gchar *path;
- pid_t my_pid;
int pid;
sscanf(file, "ghb.pid.%d", &pid);
- my_pid = getpid();
- if (my_pid == pid)
- {
- file = g_dir_read_name(gdir);
- continue;
- }
path = g_strdup_printf("%s/%s", config, file);
#if !defined(_WIN32)
find_pid:
pid = ghb_find_pid_file();
if (pid < 0)
- return FALSE;
+ goto done;
queue = ghb_load_old_queue(pid);
ghb_remove_old_queue_file(pid);
ghb_save_queue(ud->queue);
ghb_update_pending(ud);
}
+
+done:
+ ghb_write_pid_file();
+
return FALSE;
}