#include <stdlib.h>
#include <string.h>
#include <strings.h>
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
#include <assert.h>
#include <errno.h>
#include <time.h>
and closes the control connection in case of error. */
static uerr_t
getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread,
- wgint restval, ccon *con)
+ wgint restval, ccon *con, int count)
{
int csock, dtsock, local_sock, res;
uerr_t err = RETROK; /* appease the compiler */
#endif /* def __VMS [else] */
}
else if (opt.noclobber || opt.always_rest || opt.timestamping || opt.dirstruct
- || opt.output_document)
+ || opt.output_document || count > 0)
{
if (opt.unlink && file_exists_p (con->target))
{
len = f->size;
else
len = 0;
- err = getftp (u, len, &qtyread, restval, con);
+ err = getftp (u, len, &qtyread, restval, con, count);
if (con->csock == -1)
con->st &= ~DONE_CWD;