--- a/restore/tape.c
+++ b/restore/tape.c
@@ -484,7 +484,7 @@ getvol(long nextvol)
 	saved_blksread = blksread;
 	saved_tpblksread = tpblksread;
 #if defined(USE_QFA) && defined(sunos)
-	if (createtapeposflag || tapeposflag) 
+	if (createtapeposflag || tapeposflag)
 		close(fdsmtc);
 #endif
 again:
@@ -548,7 +548,7 @@ again:
 	}
 	closemt();
 
-	/* 
+	/*
 	 * if using an archive file, reset its name so readtape()
 	 * could properly use remote access.
 	 */
@@ -594,7 +594,7 @@ again:
 			char *pos;
 			(void) strncpy(magtape, buf, sizeof(magtape));
 			magtape[sizeof(magtape) - 1] = '\0';
-			if ((pos = strchr(magtape, '\n'))) 
+			if ((pos = strchr(magtape, '\n')))
 				magtape[pos - magtape] = '\0';
 		}
 	}
@@ -787,7 +787,7 @@ printdumpinfo(void)
 #endif
 }
 
-void 
+void
 printvolinfo(void)
 {
 	int i;
@@ -920,6 +920,21 @@ extractfile(struct entry *ep, int doremo
 			warn("%s: lchown", name);
 #endif
 		extractattr(name);
+
+#if defined(__linux__)
+		{
+			 struct timespec times[2];
+
+	    times[0].tv_sec  =  timep[0].tv_sec;
+	    times[0].tv_nsec =  timep[0].tv_usec/1000;
+	    times[1].tv_sec  =  timep[1].tv_sec;
+	    times[1].tv_nsec =  timep[1].tv_usec/1000;
+
+			if (utimensat(AT_FDCWD, name, times, AT_SYMLINK_NOFOLLOW) < 0)
+				 warn("%s: file timestamp update failed", name);
+		}
+#endif
+
 		return (GOOD);
 	}
 
@@ -1079,7 +1094,7 @@ extractattr(char *path)
 			break;
 		case EXT_XATTR: {
 			char xattr[XATTR_MAXSIZE];
-			
+
 			if (readxattr(xattr) == GOOD) {
 				xattr_extract(path, xattr);
 				break;
@@ -1412,7 +1427,7 @@ loop:
 		if (ftruncate(ofile, origsize) < 0)
 			warn("%s: ftruncate", curfile.name);
 	}
-	if (!readingmaps) 
+	if (!readingmaps)
 		findinode(&spcl);
 	gettingfile = 0;
 }
@@ -1525,14 +1540,14 @@ xtrcmpfile(char *buf, size_t size)
 
 	if (cmperror)
 		return;
-	
+
 	if (read(ifile, cmpbuf, size) != (ssize_t)size) {
-		fprintf(stderr, "%s: size has changed.\n", 
+		fprintf(stderr, "%s: size has changed.\n",
 			curfile.name);
 		cmperror = 1;
 		return;
 	}
-	
+
 	if (memcmp(buf, cmpbuf, size) != 0) {
 		fprintf(stderr, "%s: tape and disk copies are different\n",
 			curfile.name);
@@ -1552,9 +1567,9 @@ xtrcmpskip(UNUSED(char *buf), size_t siz
 
 	if (cmperror)
 		return;
-	
+
 	if (read(ifile, cmpbuf, size) != (ssize_t)size) {
-		fprintf(stderr, "%s: size has changed.\n", 
+		fprintf(stderr, "%s: size has changed.\n",
 			curfile.name);
 		cmperror = 1;
 		return;
@@ -1677,7 +1692,7 @@ cmpfiles(char *tapefile, char *diskfile,
 					tapefile, newname);
 			}
 		}
-		
+
 		/* don't unlink the file (it's not there anymore */
 		/* anyway) */
 		return (0);
@@ -1697,7 +1712,7 @@ static void
 compareattr(char *name)
 {
 	int xattr_done = 0;
-	
+
 	while (spcl.c_flags & DR_EXTATTRIBUTES) {
 		switch (spcl.c_extattributes) {
 		case EXT_MACOSFNDRINFO:
@@ -1893,7 +1908,7 @@ comparefile(char *name)
 			if (!cmperror) {
 				char c;
 				if (read(ifile, &c, 1) != 0) {
-					fprintf(stderr, "%s: size has changed.\n", 
+					fprintf(stderr, "%s: size has changed.\n",
 						name);
 					cmperror = 1;
 				}
@@ -1953,7 +1968,7 @@ readtape(char *buf)
 static void
 readtape_set(char *buf)
 {
-	if (!zflag) 
+	if (!zflag)
 		readtape_func = readtape_uncompr;
 	else {
 		newcomprbuf(ntrec);
@@ -2105,13 +2120,13 @@ getmore:
 
 /*
  * Read a compressed format block from a file or pipe and uncompress it.
- * Attempt to handle read errors, and end of file. 
+ * Attempt to handle read errors, and end of file.
  */
 static void
 readtape_comprfile(char *buf)
 {
 	long rl, size, i, ret;
-	int newvol; 
+	int newvol;
 	struct tapebuf *tpb;
 
 	if (blkcnt < numtrec) {
@@ -2319,7 +2334,7 @@ decompress_tapebuf(struct tapebuf *tpbin
 #ifndef HAVE_ZLIB
 			errx(1,"This restore version doesn't support zlib decompression");
 #else
-			cresult = uncompress(comprbuf, &worklen, 
+			cresult = uncompress(comprbuf, &worklen,
 					     tpbin->buf, blocklen);
 			output = comprbuf;
 			switch (cresult) {
@@ -2349,7 +2364,7 @@ decompress_tapebuf(struct tapebuf *tpbin
 #else
 			unsigned int worklen2 = worklen;
 			cresult = BZ2_bzBuffToBuffDecompress(
-					comprbuf, &worklen2, 
+					comprbuf, &worklen2,
 					tpbin->buf, blocklen, 0, 0);
 			worklen = worklen2;
 			output = comprbuf;
@@ -2457,7 +2472,7 @@ msg_read_error(char *m)
  * readtape_set can set the correct function pointer for readtape().
  * Note that the first block of each tape/file is not compressed
  * and does not have a prefix.
- */ 
+ */
 static void
 findtapeblksize(void)
 {
@@ -2485,7 +2500,7 @@ findtapeblksize(void)
 		cvtflag++;
 		if (converthead(&spclpt) == FAIL) {
 			/* Special case for old compressed tapes with prefix */
-			if (magtapein && (i % TP_BSIZE != 0)) 
+			if (magtapein && (i % TP_BSIZE != 0))
 				goto oldformat;
 			errx(1, "Tape is not a dump tape");
 		}
@@ -2508,7 +2523,7 @@ findtapeblksize(void)
 				     "\'-b %d\' ", spclpt.c_ntrec);
 			ntrec = spclpt.c_ntrec;
 			len = (ntrec - 1) * TP_BSIZE;
-			zflag = 1;   
+			zflag = 1;
 		}
 		else {
 			/* read in the rest of the block based on bufsize */
@@ -2526,7 +2541,7 @@ findtapeblksize(void)
 	/*
 	 * If the input is a tape, we tried to read ntrec * TP_BSIZE bytes.
 	 * If the value of ntrec is too large, we read less than
-	 * what we asked for; adjust the value of ntrec and test for 
+	 * what we asked for; adjust the value of ntrec and test for
 	 * a compressed dump tape.
 	 */
 	if (i % TP_BSIZE != 0) {
@@ -2580,7 +2595,7 @@ static int read_a_block(int fd, char *bu
 			i = rmtread(buf, size);
 		else
 #endif
-			i = read(fd, buf, size);                 
+			i = read(fd, buf, size);
 
 		if (i <= 0)
 			break; /* EOD or error */
@@ -2768,7 +2783,7 @@ good:
 		buf->c_dinode.di_size = buf->c_count * TP_BSIZE;
 		if (buf->c_count > TP_NINDIR)
 			readmapflag = 1;
-		else 
+		else
 			for (i = 0; i < buf->c_count; i++)
 				buf->c_addr[i]++;
 		break;
@@ -2817,7 +2832,7 @@ converttapebuf(struct tapebuf *tpb)
 			unsigned int    compressed:1;
 		} tb;
 		swabst((u_char *)"i", (u_char *)tpb);
-		memcpy(&tb, tpb, 4);	
+		memcpy(&tb, tpb, 4);
 		tpb->length = tb.length;
 		tpb->flags = tb.flags;
 		tpb->compressed = tb.compressed;
@@ -3258,7 +3273,7 @@ GetTapePos(long long *pos)
 	}
 	if (err) {
 		err = errno;
-		fprintf(stdout, "[%ld] error: %d (getting tapepos: %lld)\n", 
+		fprintf(stdout, "[%ld] error: %d (getting tapepos: %lld)\n",
 			(unsigned long)getpid(), err, *pos);
 		return err;
 	}
@@ -3292,7 +3307,7 @@ GotoTapePos(long long pos)
 	}
 	if (err) {
 		err = errno;
-		fprintf(stdout, "[%ld] error: %d (setting tapepos: %lld)\n", 
+		fprintf(stdout, "[%ld] error: %d (setting tapepos: %lld)\n",
 			(unsigned long)getpid(), err, pos);
 		return err;
 	}
