Skip to content

Commit 9064bdd

Browse files
committed
incusd/main_forknet: Tweak process title
Signed-off-by: Stéphane Graber <[email protected]>
1 parent 6277b25 commit 9064bdd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cmd/incusd/main_forknet.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,14 @@ static void forkdonetdhcp() {
135135
}
136136
137137
// Set the process title.
138-
(void)setproctitle("[incus DHCP] eth0");
138+
char *workdir = advance_arg(false);
139+
if (workdir != NULL) {
140+
char *title = malloc(sizeof(char)*strlen(workdir)+19);
141+
if (title != NULL) {
142+
sprintf(title, "[incus dhcp] %s eth0", workdir);
143+
(void)setproctitle(title);
144+
}
145+
}
139146
140147
// Jump back to Go for the rest
141148
}

0 commit comments

Comments
 (0)