Download raw body.
mark got_privsep_exec_child as __dead
On Fri, Dec 17, 2021 at 08:30:25PM +0100, Omar Polo wrote:
> Hello,
>
> this caught my eye, there's a reason got_privsep_exec_child is not
> marked as __dead? it reads slightly better IMHO.
OK by me for this patch. Thanks!
> P.S.: is the cast to char * for NULL really needed?
>
> diff 6fb1bce12800c38f0f74e56f0b45beb0a58402a1 /home/op/w/got-dead
> blob - ce62cbf5e948bfee2b29b0f0524208b1a15a93e9
> file + lib/got_lib_privsep.h
> --- lib/got_lib_privsep.h
> +++ lib/got_lib_privsep.h
> @@ -588,4 +588,4 @@ const struct got_error *got_privsep_recv_traversed_com
> struct got_commit_object **, struct got_object_id **,
> struct got_object_id_queue *, struct imsgbuf *);
>
> -void got_privsep_exec_child(int[2], const char *, const char *);
> +__dead void got_privsep_exec_child(int[2], const char *, const char *);
> blob - 6cf7e9a2ee72ca78311d0d9a16088324b574dfd6
> file + lib/privsep.c
> --- lib/privsep.c
> +++ lib/privsep.c
> @@ -2755,7 +2755,7 @@ got_privsep_unveil_exec_helpers(void)
> return NULL;
> }
>
> -void
> +__dead void
> got_privsep_exec_child(int imsg_fds[2], const char *path, const char *repo_path)
> {
> if (close(imsg_fds[0]) == -1) {
> @@ -2770,9 +2770,8 @@ got_privsep_exec_child(int imsg_fds[2], const char *pa
>
> closefrom(GOT_IMSG_FD_CHILD + 1);
>
> - if (execl(path, path, repo_path, (char *)NULL) == -1) {
> - fprintf(stderr, "%s: %s: %s\n", getprogname(), path,
> - strerror(errno));
> - _exit(1);
> - }
> + execl(path, path, repo_path, (char *)NULL);
> + fprintf(stderr, "%s: %s: %s\n", getprogname(), path,
> + strerror(errno));
> + _exit(1);
> }
>
>
mark got_privsep_exec_child as __dead