destination device must be opened O_RDWR because device_size_get() might need to read()

(Logical change 1.363)
edge.strict_endians
elisa-laajakaista.fi!szaka 2004-04-13 22:56:11 +00:00
parent c7f948d554
commit 443662a5d6
1 changed files with 2 additions and 1 deletions

View File

@ -1046,7 +1046,8 @@ int main(int argc, char **argv)
if ((fd_out = fileno(stdout)) == -1)
perr_exit("fileno for stdout failed");
} else {
int flags = O_WRONLY;
/* device_size_get() might need to read() */
int flags = O_RDWR;
if (!opt.blkdev_out) {
flags |= O_CREAT | O_TRUNC;