*/
/*
- * $Id: amandad.c,v 1.18 2006/08/21 20:17:09 martinea Exp $
+ * $Id: amandad.c,v 1.18.2.1 2006/09/15 17:18:06 martinea Exp $
*
* handle client-host side of Amanda network communications, including
* security checks, execution of the proper service, and acking the
aclose(data_write[0][0]);
aclose(data_write[0][1]);
+ for (i = 0; i < DATA_FD_COUNT; i++) {
+ aclose(data_read[i + 1][0]);
+ aclose(data_write[i + 1][1]);
+ }
+
/*
* Make sure they are not open in the range DATA_FD_OFFSET to
* DATA_FD_OFFSET + DATA_FD_COUNT*2 - 1
data_write[i + 1][0] = newfd;
}
}
- for (i = 0; i < DATA_FD_COUNT; i++)
+ for (i = 0; i < DATA_FD_COUNT*2; i++)
close(DATA_FD_OFFSET + i);
/*
error("dup %d to %d failed: %s\n", data_read[i + 1][1],
i + DATA_FD_OFFSET, strerror(errno));
}
- aclose(data_read[i + 1][0]);
aclose(data_read[i + 1][1]);
if (dup2(data_write[i + 1][0], i*2 + 1 + DATA_FD_OFFSET) < 0) {
i + DATA_FD_OFFSET, strerror(errno));
}
aclose(data_write[i + 1][0]);
- aclose(data_write[i + 1][1]);
}
/* close all unneeded fd */