~ubuntu-branches/ubuntu/trusty/apt/trusty

« back to all changes in this revision

Viewing changes to methods/server.cc

  • Committer: Package Import Robot
  • Author(s): Michael Vogt
  • Date: 2014-02-07 21:03:22 UTC
  • mfrom: (1.4.80 sid)
  • Revision ID: package-import@ubuntu.com-20140207210322-s7f833aga98ibdkm
Tags: 0.9.15.1ubuntu1
mergedĀ fromĀ debian/sid

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#include <apt-pkg/hashes.h>
18
18
#include <apt-pkg/netrc.h>
19
19
 
 
20
#include <fcntl.h>
20
21
#include <sys/stat.h>
21
22
#include <sys/time.h>
22
 
#include <utime.h>
23
23
#include <unistd.h>
24
24
#include <signal.h>
25
25
#include <stdio.h>
368
368
{
369
369
   if (FailFd == -1)
370
370
      _exit(100);
 
371
 
 
372
   struct timespec times[2];
 
373
   times[0].tv_sec = FailTime;
 
374
   times[1].tv_sec = FailTime;
 
375
   times[0].tv_nsec = times[1].tv_nsec = 0;
 
376
   futimens(FailFd, times);
371
377
   close(FailFd);
372
 
   
373
 
   // Timestamp
374
 
   struct utimbuf UBuf;
375
 
   UBuf.actime = FailTime;
376
 
   UBuf.modtime = FailTime;
377
 
   utime(FailFile.c_str(),&UBuf);
378
 
   
 
378
 
379
379
   _exit(100);
380
380
}
381
381
                                                                        /*}}}*/
539
539
            File = 0;
540
540
            
541
541
            // Timestamp
542
 
            struct utimbuf UBuf;
543
 
            time(&UBuf.actime);
544
 
            UBuf.actime = Server->Date;
545
 
            UBuf.modtime = Server->Date;
546
 
            utime(Queue->DestFile.c_str(),&UBuf);
 
542
            struct timespec times[2];
 
543
            times[0].tv_sec = times[1].tv_sec = Server->Date;
 
544
            times[0].tv_nsec = times[1].tv_nsec = 0;
 
545
            utimensat(AT_FDCWD, Queue->DestFile.c_str(), times, AT_SYMLINK_NOFOLLOW);
547
546
 
548
547
            // Send status to APT
549
548
            if (Result == true)