summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2009-05-18 09:53:56 -0700
committerSan Mehat <san@google.com>2009-05-18 09:53:56 -0700
commitc869ac135194dedcc218c4e1a8ad26a391d19208 (patch)
tree40004e86f527ca248d0daa7feed494e5fe528a49
parentcbb96659ea274f612c178abcf3abe8de4298e55f (diff)
downloaddosfstools-c869ac135194dedcc218c4e1a8ad26a391d19208.tar.gz
dosfsck: Add custom exit code for the case where the FS is read only
Signed-off-by: San Mehat <san@google.com>
-rw-r--r--src/io.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/io.c b/src/io.c
index 0ab0bbf..e1b07fc 100644
--- a/src/io.c
+++ b/src/io.c
@@ -76,8 +76,10 @@ void fs_open(char *path,int rw)
{
struct stat stbuf;
- if ((fd = open(path,rw ? O_RDWR : O_RDONLY)) < 0)
- pdie("open %s",path);
+ if ((fd = open(path,rw ? O_RDWR : O_RDONLY)) < 0) {
+ perror("open");
+ exit(6);
+ }
changes = last = NULL;
did_change = 0;