summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/utils.c b/utils.c
index 582a2f6..58c2246 100644
--- a/utils.c
+++ b/utils.c
@@ -18,7 +18,7 @@ const char *default_srv_config = "{"
18 "\"prefix\": \"\"," 18 "\"prefix\": \"\","
19 "\"address\": \"127.0.0.1\"," 19 "\"address\": \"127.0.0.1\","
20 "\"port\": 8001," 20 "\"port\": 8001,"
21 "\"layout\": 2," 21 "\"layout\": 0.0,"
22 "\"dbglevel\": 0," 22 "\"dbglevel\": 0,"
23 "\"queue_retry_minutes\": 2," 23 "\"queue_retry_minutes\": 2,"
24 "\"queue_retry_max\": 10," 24 "\"queue_retry_max\": 10,"
@@ -103,6 +103,9 @@ int initdb(const char *basedir)
103 103
104 srv_config = xs_json_loads(default_srv_config); 104 srv_config = xs_json_loads(default_srv_config);
105 105
106 xs *layout = xs_number_new(db_layout);
107 srv_config = xs_dict_set(srv_config, "layout", layout);
108
106 printf("Network address [%s]:\n", xs_dict_get(srv_config, "address")); 109 printf("Network address [%s]:\n", xs_dict_get(srv_config, "address"));
107 { 110 {
108 xs *i = xs_strip(xs_readline(stdin)); 111 xs *i = xs_strip(xs_readline(stdin));
@@ -148,6 +151,9 @@ int initdb(const char *basedir)
148 xs *udir = xs_fmt("%s/user", srv_basedir); 151 xs *udir = xs_fmt("%s/user", srv_basedir);
149 mkdir(udir, 0755); 152 mkdir(udir, 0755);
150 153
154 xs *odir = xs_fmt("%s/object", srv_basedir);
155 mkdir(odir, 0755);
156
151 xs *gfn = xs_fmt("%s/greeting.html", srv_basedir); 157 xs *gfn = xs_fmt("%s/greeting.html", srv_basedir);
152 if ((f = fopen(gfn, "w")) == NULL) { 158 if ((f = fopen(gfn, "w")) == NULL) {
153 printf("ERROR: cannot create '%s'\n", gfn); 159 printf("ERROR: cannot create '%s'\n", gfn);