Skip to content

Commit 68f5d49

Browse files
committed
fixup! gvfs-helper-client: clean up server process(es)
I had to change where the atexit() was registered in order to make sure things ran at the right place.
1 parent b8d292f commit 68f5d49

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gvfs-helper-client.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ static struct object_directory *gh_client__chosen_odb;
3838
#define CAP_OBJECTS__VERB_POST_NAME "post"
3939
#define CAP_OBJECTS__VERB_PREFETCH_NAME "prefetch"
4040

41+
static void stop_gh_server_subprocesses(void);
42+
4143
static int gh_client__start_fn(struct subprocess_entry *subprocess)
4244
{
4345
static int versions[] = {1, 0};
@@ -48,6 +50,8 @@ static int gh_client__start_fn(struct subprocess_entry *subprocess)
4850

4951
struct gh_server__process *entry = (struct gh_server__process *)subprocess;
5052

53+
atexit(stop_gh_server_subprocesses);
54+
5155
return subprocess_handshake(subprocess, "gvfs-helper", versions,
5256
NULL, capabilities,
5357
&entry->supported_capabilities);
@@ -405,7 +409,6 @@ static struct gh_server__process *gh_client__find_long_running_process(
405409
gh_server__subprocess_map_initialized = 1;
406410
hashmap_init(&gh_server__subprocess_map,
407411
(hashmap_cmp_fn)cmd2process_cmp, NULL, 0);
408-
atexit(stop_gh_server_subprocesses);
409412
entry = NULL;
410413
} else
411414
entry = (struct gh_server__process *)subprocess_find_entry(

0 commit comments

Comments
 (0)