static int sideband_demux(int in, int out, void *data)
{
int *fd = data;
+#ifdef NO_PTHREADS
+ close(fd[1]);
+#endif
int ret = recv_sideband("send-pack", fd[0], out);
close(out);
return ret;
if (pack_objects(out, remote_refs, extra_have, args) < 0) {
for (ref = remote_refs; ref; ref = ref->next)
ref->status = REF_STATUS_NONE;
+ if (args->stateless_rpc)
+ close(out);
if (use_sideband)
finish_async(&demux);
return -1;