ubase

suckless linux base utils
git clone git://git.2f30.org/ubase.git
Log | Files | Refs | README | LICENSE

commit ac08f70d90893efda02429bf7a4703848479f210
parent c552a7ee74f1e2658de6aaf3b67b1656dc920952
Author: Eivind Uggedal <eivind@uggedal.com>
Date:   Tue Mar 15 16:02:33 +0000

dd: always create of= even if seek= is used

Diffstat:
dd.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dd.c b/dd.c @@ -42,7 +42,7 @@ static int 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_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; @@ -106,7 +106,7 @@ prepare_copy(struct dd_config *ddc, int *ifd, int *ofd) } if (!ddc->seek) - flo |= O_CREAT|O_TRUNC; + flo |= O_TRUNC; if (!ddc->out) *ofd = 1; else if ((*ofd = open(ddc->out, flo, st.st_mode)) < 0) {