/*
* Copyright (c) 2006 Franck Bui-Huu
*/
-#include <time.h>
#include "cache.h"
#include "builtin.h"
#include "archive.h"
#include "pkt-line.h"
#include "sideband.h"
-#include <sys/wait.h>
-#include <sys/poll.h>
static const char upload_archive_usage[] =
"git-upload-archive <repo>";
char buf[16384];
ssize_t sz = read(child_fd, buf, sizeof(buf));
if (sz < 0) {
- if (errno != EINTR)
+ if (errno != EAGAIN && errno != EINTR)
error_clnt("read error: %s\n", strerror(errno));
return;
}
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)