]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair in no-modify mode opens the filesystem device read-only now
authorNathan Scott <nathans@sgi.com>
Sun, 3 Feb 2002 04:29:50 +0000 (04:29 +0000)
committerNathan Scott <nathans@sgi.com>
Sun, 3 Feb 2002 04:29:50 +0000 (04:29 +0000)
(fix from Chris Pascoe).

repair/io.c

index 35de4d87034325c8663f3e085c038fb3e94396a8..e12b7bae99920854ae95e9dd7ac45d4a79ebfe3f 100644 (file)
@@ -45,7 +45,7 @@ io_init(void)
 
        ASSERT(fs_name != NULL && *fs_name != '\0');
 
-       if ((fs_fd = open (fs_name, O_RDWR)) < 0)  {
+       if ((fs_fd = open (fs_name, (no_modify? O_RDONLY : O_RDWR))) < 0)  {
                do_error("couldn't open filesystem \"%s\"\n",
                         fs_name);
        }