summaryrefslogtreecommitdiff
path: root/methods/server.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-01-26 08:15:29 +0100
committerMichael Vogt <mvo@debian.org>2014-01-26 08:15:29 +0100
commit796673c38509300c988fbba2f2679ba3c76916db (patch)
tree403055b486d0a1d65561528582d4b0bdc66e53a0 /methods/server.cc
parent9aef3908c892f9d9349d8bf8a5ceaeea313ba0fe (diff)
parent2f958de6e883ba7b0c9895750d4dde35047f1e82 (diff)
Merge remote-tracking branch 'donkult/debian/sid' into debian/sid
Conflicts: apt-private/private-list.cc doc/po/de.po test/integration/framework
Diffstat (limited to 'methods/server.cc')
-rw-r--r--methods/server.cc25
1 files changed, 12 insertions, 13 deletions
diff --git a/methods/server.cc b/methods/server.cc
index a2128441c..e12c23c07 100644
--- a/methods/server.cc
+++ b/methods/server.cc
@@ -17,9 +17,9 @@
#include <apt-pkg/hashes.h>
#include <apt-pkg/netrc.h>
+#include <fcntl.h>
#include <sys/stat.h>
#include <sys/time.h>
-#include <utime.h>
#include <unistd.h>
#include <signal.h>
#include <stdio.h>
@@ -368,14 +368,14 @@ void ServerMethod::SigTerm(int)
{
if (FailFd == -1)
_exit(100);
+
+ struct timespec times[2];
+ times[0].tv_sec = FailTime;
+ times[1].tv_sec = FailTime;
+ times[0].tv_nsec = times[1].tv_nsec = 0;
+ futimens(FailFd, times);
close(FailFd);
-
- // Timestamp
- struct utimbuf UBuf;
- UBuf.actime = FailTime;
- UBuf.modtime = FailTime;
- utime(FailFile.c_str(),&UBuf);
-
+
_exit(100);
}
/*}}}*/
@@ -539,11 +539,10 @@ int ServerMethod::Loop()
File = 0;
// Timestamp
- struct utimbuf UBuf;
- time(&UBuf.actime);
- UBuf.actime = Server->Date;
- UBuf.modtime = Server->Date;
- utime(Queue->DestFile.c_str(),&UBuf);
+ struct timespec times[2];
+ times[0].tv_sec = times[1].tv_sec = Server->Date;
+ times[0].tv_nsec = times[1].tv_nsec = 0;
+ utimensat(AT_FDCWD, Queue->DestFile.c_str(), times, AT_SYMLINK_NOFOLLOW);
// Send status to APT
if (Result == true)