]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
badblocks.c (main): Appled sourceforge patch #600451, which
authorTheodore Ts'o <tytso@mit.edu>
Mon, 30 Sep 2002 02:37:40 +0000 (22:37 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 30 Sep 2002 02:37:40 +0000 (22:37 -0400)
addresses sourceforge bug #600388, by AEF.  This allows
badblocks to work correctly on read-only devices such as
CD-ROM's, DVD's, etc.

misc/ChangeLog
misc/badblocks.c

index 772adddeecbbcbbebc0fa58f7b53960d3a2b7eb0..ed6a4cddb671bca10425abc15dcd11127efbb63d 100644 (file)
@@ -1,3 +1,10 @@
+2002-09-29  Theodore Ts'o  <tytso@mit.edu>
+
+       * badblocks.c (main): Appled sourceforge patch #600451, which
+               addresses sourceforge bug #600388, by AEF.  This allows
+               badblocks to work correctly on read-only devices such as
+               CD-ROM's, DVD's, etc.
+
 2002-09-24  Theodore Ts'o  <tytso@mit.edu>
 
        * mke2fs.8.in, tune2fs.8.in: Clarify manual pages about using the
index 38106153a1bd35c060f5faa8538a35c52fb1ebf6..8840d9b5cb9afa9e80aad30c6110da24821f4ce0 100644 (file)
@@ -763,7 +763,8 @@ int main (int argc, char ** argv)
                check_mount(device_name);
        
        dev = open (device_name, O_RDWR);
-       if ((dev == -1) && ((errno == EPERM) || (errno == EACCES)) &&
+       if ((dev == -1) && ((errno == EPERM) || (errno == EACCES) ||
+                           (errno == EROFS)) &&
            (w_flag == 0))
                dev = open(device_name, O_RDONLY);
        if (dev == -1) {