commit edb9a1809d3b83a6eb573160c0c60b19a65a383d from: Omar Polo via: Thomas Adam date: Sun Mar 13 21:25:37 2022 UTC got patch: re-add forgotten lseek otherwise got-read-patch can't parse any patch because the position indicator is at the end of file. While here fix the return too and set patchfd to -1 on error (stsp suggestion.) ok thomas, stsp commit - 2d0f364c3c7dcf075322c2a61665f8624e44bf0c commit + edb9a1809d3b83a6eb573160c0c60b19a65a383d blob - 11d36a730e5039b5bccac10a1560f5830fd0eb1c blob + 722fa685e1e895ba46accb2c2b0a9ef9f8321fc8 --- got/got.c +++ got/got.c @@ -7150,9 +7150,15 @@ patch_from_stdin(int *patchfd) signal(SIGINT, sigint); signal(SIGQUIT, sigquit); - if (err != NULL) + if (err == NULL && lseek(*patchfd, 0, SEEK_SET) == -1) + err = got_error_from_errno("lseek"); + + if (err != NULL) { close(*patchfd); - return NULL; + *patchfd = -1; + } + + return err; } static const struct got_error *