aboutsummaryrefslogtreecommitdiff
path: root/miscutils/nandwrite.c
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils/nandwrite.c')
-rw-r--r--miscutils/nandwrite.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/miscutils/nandwrite.c b/miscutils/nandwrite.c
index 2ba6e3fe5..c636a5aa2 100644
--- a/miscutils/nandwrite.c
+++ b/miscutils/nandwrite.c
@@ -129,7 +129,7 @@ int nandwrite_main(int argc UNUSED_PARAM, char **argv)
xmove_fd(tmp_fd, IS_NANDDUMP ? STDOUT_FILENO : STDIN_FILENO);
}
- fd = xopen(argv[0], O_RDWR);
+ fd = xopen(argv[0], IS_NANDWRITE ? O_RDWR : O_RDONLY);
xioctl(fd, MEMGETINFO, &meminfo);
mtdoffset = xstrtou(opt_s, 0);