commit ca6444c5b3830627626458222ef3f16852e3505f from: Omar Polo date: Fri Mar 11 17:25:33 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 - 33df9995672a4f24ded6f8cd1575637e47d27921 commit + ca6444c5b3830627626458222ef3f16852e3505f blob - 175740d9c6f4b9443624418107f8b2314f6f44b0 blob + 17d637cabb59cb76c220d33c371c8c2a25da94cf --- 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 *