Code

upload-archive: monitor child communication even more carefully.
[git.git] / builtin-upload-archive.c
index 115a12dc13a09e9bfd4c965ca632709e0f1cd89b..0596865679d79e1f02877ea47fb910a7c771f38f 100644 (file)
@@ -160,7 +160,8 @@ int cmd_upload_archive(int argc, const char **argv, const char *prefix)
                if (pfd[1].revents & POLLIN)
                        /* Status stream ready */
                        process_input(pfd[1].fd, 2);
-               if ((pfd[0].revents | pfd[1].revents) == POLLIN)
+               /* Always finish to read data when available */
+               if ((pfd[0].revents | pfd[1].revents) & POLLIN)
                        continue;
 
                if (waitpid(writer, &status, 0) < 0)