summaryrefslogtreecommitdiff
path: root/nand-utils/nanddump.c
diff options
context:
space:
mode:
Diffstat (limited to 'nand-utils/nanddump.c')
-rw-r--r--nand-utils/nanddump.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/nand-utils/nanddump.c b/nand-utils/nanddump.c
index 841ed67..62699e0 100644
--- a/nand-utils/nanddump.c
+++ b/nand-utils/nanddump.c
@@ -549,7 +549,8 @@ int main(int argc, char * const argv[])
closeall:
close(fd);
- close(ofd);
+ if (ofd > 0 && ofd != STDOUT_FILENO)
+ close(ofd);
free(oobbuf);
free(readbuf);
exit(EXIT_FAILURE);