[hackers] [ubase] dd: remove if= noatime optimization || Eivind Uggedal

From: <git_AT_suckless.org>
Date: Wed, 16 Mar 2016 11:18:16 +0100 (CET)

commit e5d88b0f30feb2f0374c2e09ecd2685ba1f4e717
Author: Eivind Uggedal <eivind_AT_uggedal.com>
AuthorDate: Tue Mar 15 16:03:14 2016 +0000
Commit: sin <sin_AT_2f30.org>
CommitDate: Wed Mar 16 10:17:51 2016 +0000

    dd: remove if= noatime optimization

diff --git a/dd.c b/dd.c
index e37c6c7..07fdbc9 100644
--- a/dd.c
+++ b/dd.c
_AT_@ -43,7 +43,6 @@ prepare_copy(struct dd_config *ddc, int *ifd, int *ofd)
 {
         struct stat st;
         int fli = O_RDONLY|O_LARGEFILE|O_NOCTTY, flo = O_WRONLY|O_LARGEFILE|O_CREAT|O_NOATIME|O_NOCTTY;
- uid_t euid = 0;
         long pagesize;
 
         if (ddc->direct) {
_AT_@ -51,11 +50,6 @@ prepare_copy(struct dd_config *ddc, int *ifd, int *ofd)
                 flo |= O_DIRECT;
         }
 
- euid = geteuid();
-
- if (!euid || st.st_uid == euid)
- fli |= O_NOATIME;
-
         if (!ddc->in) *ifd = 0;
         else if ((*ifd = open(ddc->in, fli)) < 0)
                 return -1;
Received on Wed Mar 16 2016 - 11:18:16 CET

This archive was generated by hypermail 2.3.0 : Wed Mar 16 2016 - 11:24:18 CET