commit c4d68ce0204aead5a093258cb25988e5591fc080 from: Josh Rickmar via: Thomas Adam date: Sun Jul 03 22:08:19 2022 UTC Use pipe() which is a more understood syscall than pipe2() which doesn't exist on MacOS, for instance. Since we we're passing in 0 to pipe2(), this mean no fcntl() flags were being sent. As such, it's the same syscall as pipe() which also has the added benefit that it's more portable. committing on behalf of thomas with my ok commit - ea08db7370b707e1f93ff35bc8f69ad9d6043df8 commit + c4d68ce0204aead5a093258cb25988e5591fc080 blob - 0b04e3f959ed7aab07534ee9bb5cb4a63e0dd93f blob + bbdfb381160453fb6cdcae5a97db2425cc3b4f3f --- lib/sigs.c +++ lib/sigs.c @@ -99,10 +99,10 @@ got_sigs_sign_tag_ssh(pid_t *newpid, int *in_fd, int * argv[i++] = NULL; assert(i <= nitems(argv)); - if (pipe2(in_pfd, 0) == -1) - return got_error_from_errno("pipe2"); - if (pipe2(out_pfd, 0) == -1) - return got_error_from_errno("pipe2"); + if (pipe(in_pfd) == -1) + return got_error_from_errno("pipe"); + if (pipe(out_pfd) == -1) + return got_error_from_errno("pipe"); pid = fork(); if (pid == -1) { @@ -321,12 +321,12 @@ got_sigs_verify_tag_ssh(char **msg, struct got_tag_obj argv[i++] = NULL; assert(i <= nitems(argv)); - if (pipe2(in_pfd, 0) == -1) { - error = got_error_from_errno("pipe2"); + if (pipe(in_pfd) == -1) { + error = got_error_from_errno("pipe"); goto done; } - if (pipe2(out_pfd, 0) == -1) { - error = got_error_from_errno("pipe2"); + if (pipe(out_pfd) == -1) { + error = got_error_from_errno("pipe"); goto done; }