devices: Avoid using assert() to catch misconfiguration
authorMiles Kaufmann <milesck@eecs.umich.edu>
Thu, 30 Aug 2007 19:16:59 +0000 (15:16 -0400)
committerMiles Kaufmann <milesck@eecs.umich.edu>
Thu, 30 Aug 2007 19:16:59 +0000 (15:16 -0400)
--HG--
extra : convert_revision : 2c6710e01a4402793a2e0eafcc829df19d03dda3

src/dev/disk_image.cc

index b8386bc3d293b45328c892401b7017c786d22ab9..792a312044f69c30aa1d1f42fd771e4b85667e01 100644 (file)
@@ -171,7 +171,8 @@ CowDiskImage::CowDiskImage(const Params *p)
         init(p->table_size);
     } else {
         if (!open(filename)) {
-            assert(!p->read_only && "why have a non-existent read only file?");
+            if (p->read_only)
+                fatal("could not open read-only file");
             init(p->table_size);
         }