Skip to content

Commit e4e1596

Browse files
jfsmigfvennetier
authored andcommitted
gridinit_cmd: Remove unnecessary nested funcs
1 parent dc5b3f6 commit e4e1596

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

main/gridinit_cmd.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,15 +459,20 @@ send_commandv(void (*dumper)(FILE *, void*), void *udata, const char *cmd, int a
459459
return 0;
460460
}
461461

462+
static void
463+
_on_reply(FILE *in_stream, void *u)
464+
{
465+
GList **out = u;
466+
g_assert_nonnull(out);
467+
*out = read_services_list(in_stream);
468+
}
469+
462470
static int
463471
_fetch_services(GList **out)
464472
{
465473
GList *jobs = NULL;
466-
void _on_reply(FILE *in_stream, void *udata UNUSED) {
467-
jobs = read_services_list(in_stream);
468-
}
469474

470-
int rc = send_commandv(_on_reply, NULL, "status", 0, (char*[]){NULL});
475+
int rc = send_commandv(_on_reply, &jobs, "status", 0, (char*[]){NULL});
471476
if (rc != 0) {
472477
g_list_free_full(jobs, (GDestroyNotify)child_info_free);
473478
*out = NULL;

0 commit comments

Comments
 (0)