X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=inline;f=builtin-upload-archive.c;h=29446e84ccf9322e722830f5af11da0c56709fb8;hb=dda8f4bf2b159d6f8e6d816e35418708cc6f21a1;hp=c4cd1e1327f18ae27b74fac6dfd41938cd9dfe5d;hpb=864cd9491772367b3ce5b0dda98f068e5bd49680;p=git.git diff --git a/builtin-upload-archive.c b/builtin-upload-archive.c index c4cd1e132..29446e84c 100644 --- a/builtin-upload-archive.c +++ b/builtin-upload-archive.c @@ -132,7 +132,6 @@ int cmd_upload_archive(int argc, const char **argv, const char *prefix) while (1) { struct pollfd pfd[2]; - ssize_t processed[2] = { 0, 0 }; int status; pfd[0].fd = fd1[0]; @@ -147,15 +146,14 @@ int cmd_upload_archive(int argc, const char **argv, const char *prefix) } continue; } - if (pfd[0].revents & POLLIN) - /* Data stream ready */ - processed[0] = process_input(pfd[0].fd, 1); if (pfd[1].revents & POLLIN) /* Status stream ready */ - processed[1] = process_input(pfd[1].fd, 2); - /* Always finish to read data when available */ - if (processed[0] || processed[1]) - continue; + if (process_input(pfd[1].fd, 2)) + continue; + if (pfd[0].revents & POLLIN) + /* Data stream ready */ + if (process_input(pfd[0].fd, 1)) + continue; if (waitpid(writer, &status, 0) < 0) error_clnt("%s", lostchild);