Whamcloud - gitweb
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 772addd..ed6a4cd 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 3810615..8840d9b 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) {