mirror of git://git.suckless.org/ubase
dd: remove if= noatime optimization
This commit is contained in:
parent
05a69d9d0d
commit
e5d88b0f30
6
dd.c
6
dd.c
|
@ -43,7 +43,6 @@ prepare_copy(struct dd_config *ddc, int *ifd, int *ofd)
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
int fli = O_RDONLY|O_LARGEFILE|O_NOCTTY, flo = O_WRONLY|O_LARGEFILE|O_CREAT|O_NOATIME|O_NOCTTY;
|
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;
|
long pagesize;
|
||||||
|
|
||||||
if (ddc->direct) {
|
if (ddc->direct) {
|
||||||
|
@ -51,11 +50,6 @@ prepare_copy(struct dd_config *ddc, int *ifd, int *ofd)
|
||||||
flo |= O_DIRECT;
|
flo |= O_DIRECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
euid = geteuid();
|
|
||||||
|
|
||||||
if (!euid || st.st_uid == euid)
|
|
||||||
fli |= O_NOATIME;
|
|
||||||
|
|
||||||
if (!ddc->in) *ifd = 0;
|
if (!ddc->in) *ifd = 0;
|
||||||
else if ((*ifd = open(ddc->in, fli)) < 0)
|
else if ((*ifd = open(ddc->in, fli)) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue