/*
- * $Id: cache_cf.cc,v 1.189 1997/05/15 23:30:58 wessels Exp $
+ * $Id: cache_cf.cc,v 1.190 1997/05/16 07:43:54 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
if ((token = strtok(NULL, w_space)))
if (!strcasecmp(token, "read-only"))
readonly = 1;
- storeAddSwapDisk(dir, size, l1, l2, readonly);
+ if (configured_once)
+ storeReconfigureSwapDisk(dir, size, l1, l2, readonly);
+ else
+ storeAddSwapDisk(dir, size, l1, l2, readonly);
}
int
xfree(SwapDirs);
SwapDirs = tmp;
}
+ debug(20,1,"Creating Swap Dir #%d in %s\n", ncache_dirs+1, path);
tmp = SwapDirs + ncache_dirs;
tmp->path = xstrdup(path);
tmp->max_size = size;
return ++ncache_dirs;
}
+void
+storeReconfigureSwapDisk(const char *path, int size, int l1, int l2, int read_only)
+{
+ int i;
+ for (i = 0; i < ncache_dirs; i++) {
+ if (!strcmp(path, SwapDirs[i].path))
+ break;
+ }
+ if (i == ncache_dirs)
+ return;
+ SwapDirs[i].max_size = size;
+ SwapDirs[i].read_only = read_only;
+ /* ignore the rest */
+}
+
static int
storeVerifyOrCreateDir(const char *path)
{