]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fatal if we can't open a coss store file at init time, rather than
authoradrian <>
Fri, 10 Aug 2001 09:20:37 +0000 (09:20 +0000)
committeradrian <>
Fri, 10 Aug 2001 09:20:37 +0000 (09:20 +0000)
first IO time.

src/fs/coss/store_dir_coss.cc

index 623e56fa0208b1f615814ef3078915e3962dcb69..37cebe9a2e658f380df18b8e44a8ee82344e1807 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_coss.cc,v 1.24 2001/08/09 21:41:53 adrian Exp $
+ * $Id: store_dir_coss.cc,v 1.25 2001/08/10 03:20:37 adrian Exp $
  *
  * DEBUG: section 81    Store COSS Directory Routines
  * AUTHOR: Eric Stern
@@ -155,6 +155,10 @@ storeCossDirInit(SwapDir * sd)
     storeCossDirOpenSwapLog(sd);
     storeCossDirRebuild(sd);
     cs->fd = file_open(sd->path, O_RDWR | O_CREAT);
+    if (cs->fd < 0) {
+        debug(81, 1) ("%s: %s\n", sd->path, xstrerror());
+        fatal("storeCossDirInit: Failed to open a COSS directory.");
+    }
     n_coss_dirs++;
     (void) storeDirGetBlkSize(sd->path, &sd->fs.blksize);
 }