diff options
Diffstat (limited to 'src/piesctl.c')
-rw-r--r-- | src/piesctl.c | 42 |
1 files changed, 17 insertions, 25 deletions
diff --git a/src/piesctl.c b/src/piesctl.c index 626463c..b979c09 100644 --- a/src/piesctl.c +++ b/src/piesctl.c | |||
@@ -179,32 +179,24 @@ parse_config () | |||
179 | { | 179 | { |
180 | if (strcmp (instance, "pies") == 0) | 180 | if (verbose) |
181 | printf ("%s: falling back to default URL\n", program_name); | ||
182 | if (default_url) | ||
183 | url = default_url; | ||
184 | else | ||
181 | { | 185 | { |
182 | if (verbose) | 186 | int rc; |
183 | printf ("%s: falling back to default URL\n", program_name); | 187 | size_t len = 0; |
184 | if (default_url) | 188 | file_name = NULL; |
185 | url = default_url; | 189 | grecs_asprintf (&file_name, &len, DEFAULT_CONTROL_URL, instance); |
186 | else | 190 | rc = pies_url_create (&url, file_name); |
191 | free (file_name); | ||
192 | |||
193 | if (rc) | ||
187 | { | 194 | { |
188 | int rc; | 195 | grecs_error (NULL, 0, _("%s: cannot create URL: %s"), |
189 | size_t len = 0; | 196 | DEFAULT_CONTROL_URL, strerror (errno)); |
190 | file_name = NULL; | 197 | exit (EX_SOFTWARE); |
191 | grecs_asprintf (&file_name, &len, DEFAULT_CONTROL_URL, instance); | ||
192 | rc = pies_url_create (&url, file_name); | ||
193 | free (file_name); | ||
194 | |||
195 | if (rc) | ||
196 | { | ||
197 | grecs_error (NULL, 0, _("%s: cannot create URL: %s"), | ||
198 | DEFAULT_CONTROL_URL, strerror (errno)); | ||
199 | exit (EX_SOFTWARE); | ||
200 | } | ||
201 | } | 198 | } |
202 | } | 199 | } |
203 | else | ||
204 | { | ||
205 | grecs_error (NULL, 0, _("socket name for instance %s not configured"), | ||
206 | instance); | ||
207 | exit (EX_CONFIG); | ||
208 | } | ||
209 | } | 200 | } |
201 | |||
210 | if (verbose) | 202 | if (verbose) |