remove utimes() workarounds

With the addition of utimes(), we can remove the workarounds
and use the original NetBSD code for timestamping files.

Also restore use of -p & -r for install while building
This commit is contained in:
Thomas Cort
2013-04-12 18:55:40 +00:00
committed by Ben Gras
parent 3ae6c600a9
commit a0a1440a52
13 changed files with 9 additions and 118 deletions
-24
View File
@@ -64,10 +64,6 @@ __RCSID("$NetBSD: fetch.c,v 1.202 2013/02/23 13:47:36 christos Exp $");
#include <unistd.h>
#include <time.h>
#ifdef __minix
#include <utime.h>
#endif
#include "ssl.h"
#include "ftp_var.h"
#include "version.h"
@@ -1322,39 +1318,19 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
progressmeter(1);
(void)fflush(fout);
if (closefunc == fclose && mtime != -1) {
#ifdef __minix
struct utimbuf utb;
#endif /* __minix */
struct timeval tval[2];
(void)gettimeofday(&tval[0], NULL);
#ifdef __minix
utb.actime = tval[0].tv_sec;
utb.modtime = mtime;
#else /* !__minix */
tval[1].tv_sec = mtime;
tval[1].tv_usec = 0;
#endif /* !__minix */
(*closefunc)(fout);
fout = NULL;
#ifdef __minix
if (utime(savefile, &utb) == -1) {
fprintf(ttyout,
"Can't change modification time to %s",
rfc2822time(localtime(&mtime)));
}
#else /* !__minix */
if (utimes(savefile, tval) == -1) {
fprintf(ttyout,
"Can't change modification time to %s",
rfc2822time(localtime(&mtime)));
}
#endif /* !__minix */
}
if (bytes > 0)
ptransfer(0);
-19
View File
@@ -123,10 +123,6 @@ __RCSID("$NetBSD: ftp.c,v 1.164 2012/07/04 06:09:37 is Exp $");
#include <unistd.h>
#include <stdarg.h>
#ifdef __minix
#include <utime.h>
#endif
#include "ftp_var.h"
volatile sig_atomic_t abrtflag;
@@ -914,10 +910,6 @@ recvrequest(const char *cmd, const char *volatile local, const char *remote,
int oprogress;
int opreserve;
#ifdef __minix
struct utimbuf utb;
#endif
fout = NULL;
din = NULL;
hashbytes = mark;
@@ -1156,16 +1148,6 @@ recvrequest(const char *cmd, const char *volatile local, const char *remote,
mtime = remotemodtime(remote, 0);
if (mtime != -1) {
(void)gettimeofday(&tval[0], NULL);
#ifdef __minix
utb.actime = tval[0].tv_sec;
utb.modtime = mtime;
if (utime(local, &utb) == -1) {
fprintf(ttyout,
"Can't change modification time on %s to %s",
local,
rfc2822time(localtime(&mtime)));
}
#else
tval[1].tv_sec = mtime;
tval[1].tv_usec = 0;
if (utimes(local, tval) == -1) {
@@ -1174,7 +1156,6 @@ recvrequest(const char *cmd, const char *volatile local, const char *remote,
local,
rfc2822time(localtime(&mtime)));
}
#endif
}
}
}