From 443662a5d67bc48f0199cd381735cb98bd3ce781 Mon Sep 17 00:00:00 2001 From: "elisa-laajakaista.fi!szaka" Date: Tue, 13 Apr 2004 22:56:11 +0000 Subject: [PATCH] destination device must be opened O_RDWR because device_size_get() might need to read() (Logical change 1.363) --- ntfsprogs/ntfsclone.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ntfsprogs/ntfsclone.c b/ntfsprogs/ntfsclone.c index a2652816..9e86ef3a 100644 --- a/ntfsprogs/ntfsclone.c +++ b/ntfsprogs/ntfsclone.c @@ -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;