diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-02-23 11:36:33 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-02-23 12:25:47 +0200 |
commit | 6e73a7b0822d1fd506c75a662070f447bba94afb (patch) | |
tree | e121c440aff73316cb43ec05295e2c32492bf5dc | |
parent | 584266f8215d913ce0c226f63da51c77d1074f09 (diff) | |
download | pies-6e73a7b0822d1fd506c75a662070f447bba94afb.tar.gz pies-6e73a7b0822d1fd506c75a662070f447bba94afb.tar.bz2 |
Improve logging
* po/POTFILES.in: Add missing source files.
* grecs: Upgrade.
* src/diag.c (pies_diag_printer): New function.
(logfuncall): New function.
* src/pies.h: Add new prototypes.
* src/pies.c (main): Initialize grecs_print_diag_fun
* src/acl.c: Uniformly use double-quotes in messages. Use
logfuncall where applicable.
* src/comp.c: Likewise.
* src/ctl.c: Likewise.
* src/inetd-bi.c: Likewise.
* src/inetd.c: Likewise.
* src/limits.c: Likewise.
* src/piesctl.c: Likewise.
* src/progman.c: Likewise.
* src/socket.c: Likewise.
* src/sysvinit.c: Likewise.
m--------- | grecs | 0 | ||||
-rw-r--r-- | po/POTFILES.in | 15 | ||||
-rw-r--r-- | src/acl.c | 22 | ||||
-rw-r--r-- | src/comp.c | 10 | ||||
-rw-r--r-- | src/ctl.c | 5 | ||||
-rw-r--r-- | src/diag.c | 42 | ||||
-rw-r--r-- | src/inetd-bi.c | 3 | ||||
-rw-r--r-- | src/inetd.c | 8 | ||||
-rw-r--r-- | src/limits.c | 7 | ||||
-rw-r--r-- | src/pies.c | 29 | ||||
-rw-r--r-- | src/pies.h | 4 | ||||
-rw-r--r-- | src/piesctl.c | 34 | ||||
-rw-r--r-- | src/progman.c | 21 | ||||
-rw-r--r-- | src/socket.c | 20 | ||||
-rw-r--r-- | src/sysvinit.c | 7 |
15 files changed, 111 insertions, 116 deletions
diff --git a/grecs b/grecs | |||
Subproject 07838fb2e9ed5769074add028e052a3b667e67e | Subproject 8241dc04501f62b613f17f5c165f915a216ba30 | ||
diff --git a/po/POTFILES.in b/po/POTFILES.in index 6923cb6..2496b6e 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in | |||
@@ -37,3 +37,18 @@ src/piesctl-cl.h | |||
37 | lib/grecsasrt.c | 37 | lib/grecsasrt.c |
38 | lib/netrc.c | 38 | lib/netrc.c |
39 | lib/pp.c | 39 | lib/pp.c |
40 | |||
41 | grecs/src/cidr.c | ||
42 | grecs/src/format.c | ||
43 | grecs/src/grecs-gram.y | ||
44 | grecs/src/grecs-lex.l | ||
45 | grecs/src/json-gram.y | ||
46 | grecs/src/meta1-gram.y | ||
47 | grecs/src/meta1-lex.l | ||
48 | grecs/src/opthelp.c | ||
49 | grecs/src/path-parser.c | ||
50 | grecs/src/preproc.c | ||
51 | grecs/src/sockaddr.c | ||
52 | grecs/src/symtab.c | ||
53 | grecs/src/tree.c | ||
54 | grecs/src/wordsplit.c | ||
@@ -177,7 +177,7 @@ _parse_sockaddr (struct acl_entry *entry, const grecs_value_t *value) | |||
177 | if (len >= sizeof (s_un->sun_path)) | 177 | if (len >= sizeof (s_un->sun_path)) |
178 | { | 178 | { |
179 | grecs_error (&entry->locus, 0, | 179 | grecs_error (&entry->locus, 0, |
180 | _("socket name too long: `%s'"), string); | 180 | _("socket name too long: %s"), string); |
181 | return 1; | 181 | return 1; |
182 | } | 182 | } |
183 | sptr = create_acl_sockaddr (AF_UNIX, sizeof (s_un)); | 183 | sptr = create_acl_sockaddr (AF_UNIX, sizeof (s_un)); |
@@ -200,7 +200,7 @@ _parse_sockaddr (struct acl_entry *entry, const grecs_value_t *value) | |||
200 | if (!hp) | 200 | if (!hp) |
201 | { | 201 | { |
202 | grecs_error (&entry->locus, 0, | 202 | grecs_error (&entry->locus, 0, |
203 | _("cannot resolve host name: `%s'"), string); | 203 | _("cannot resolve host name: %s"), string); |
204 | if (p) | 204 | if (p) |
205 | *p = '/'; | 205 | *p = '/'; |
206 | return 1; | 206 | return 1; |
@@ -237,14 +237,14 @@ _parse_sockaddr (struct acl_entry *entry, const grecs_value_t *value) | |||
237 | if (inet_aton (p, &addr) == 0) | 237 | if (inet_aton (p, &addr) == 0) |
238 | { | 238 | { |
239 | grecs_error (&entry->locus, 0, | 239 | grecs_error (&entry->locus, 0, |
240 | _("invalid netmask: `%s'"), p); | 240 | _("invalid netmask: %s"), p); |
241 | return 1; | 241 | return 1; |
242 | } | 242 | } |
243 | sptr->netmask = addr.s_addr; | 243 | sptr->netmask = addr.s_addr; |
244 | } | 244 | } |
245 | else | 245 | else |
246 | { | 246 | { |
247 | grecs_error (&entry->locus, 0, _("invalid netmask: `%s'"), p); | 247 | grecs_error (&entry->locus, 0, _("invalid netmask: %s"), p); |
248 | return 1; | 248 | return 1; |
249 | } | 249 | } |
250 | } | 250 | } |
@@ -281,12 +281,12 @@ _parse_from (struct acl_entry *entry, size_t argc, grecs_value_t **argv) | |||
281 | return 0; | 281 | return 0; |
282 | else if (argv[0]->type == GRECS_TYPE_LIST) | 282 | else if (argv[0]->type == GRECS_TYPE_LIST) |
283 | { | 283 | { |
284 | grecs_error (&entry->locus, 0, _("expected `from', but found list")); | 284 | grecs_error (&entry->locus, 0, _("expected \"from\", but found list")); |
285 | return 1; | 285 | return 1; |
286 | } | 286 | } |
287 | else if (strcmp (argv[0]->v.string, "from")) | 287 | else if (strcmp (argv[0]->v.string, "from")) |
288 | { | 288 | { |
289 | grecs_error (&entry->locus, 0, _("expected `from', but found `%s'"), | 289 | grecs_error (&entry->locus, 0, _("expected \"from\", but found \"%s\""), |
290 | argv[0]->v.string); | 290 | argv[0]->v.string); |
291 | return 1; | 291 | return 1; |
292 | } | 292 | } |
@@ -296,7 +296,7 @@ _parse_from (struct acl_entry *entry, size_t argc, grecs_value_t **argv) | |||
296 | if (argc == 0) | 296 | if (argc == 0) |
297 | { | 297 | { |
298 | grecs_error (&entry->locus, 0, | 298 | grecs_error (&entry->locus, 0, |
299 | _("unexpected end of statement after `from'")); | 299 | _("unexpected end of statement after \"from\"")); |
300 | return 1; | 300 | return 1; |
301 | } | 301 | } |
302 | 302 | ||
@@ -321,7 +321,7 @@ _parse_from (struct acl_entry *entry, size_t argc, grecs_value_t **argv) | |||
321 | 321 | ||
322 | if (argc - 1) | 322 | if (argc - 1) |
323 | { | 323 | { |
324 | grecs_warning (&entry->locus, 0, _("junk after `from' list")); | 324 | grecs_warning (&entry->locus, 0, _("junk after from-list")); |
325 | return 1; | 325 | return 1; |
326 | } | 326 | } |
327 | return 0; | 327 | return 0; |
@@ -354,8 +354,8 @@ _parse_sub_acl (struct acl_entry *entry, size_t argc, grecs_value_t **argv) | |||
354 | 354 | ||
355 | if (!entry->acl) | 355 | if (!entry->acl) |
356 | { | 356 | { |
357 | grecs_error (&entry->locus, 0, _("ACL not defined: `%s'"), | 357 | grecs_error (&entry->locus, 0, _("ACL not defined: %s"), |
358 | argv[0]->v.string); | 358 | argv[0]->v.string); |
359 | return 1; | 359 | return 1; |
360 | } | 360 | } |
361 | argc--; | 361 | argc--; |
@@ -432,7 +432,7 @@ parse_acl_line (grecs_locus_t *locus, int allow, pies_acl_t acl, | |||
432 | case GRECS_TYPE_STRING: | 432 | case GRECS_TYPE_STRING: |
433 | if (_parse_token (entry, value)) | 433 | if (_parse_token (entry, value)) |
434 | { | 434 | { |
435 | grecs_error (&entry->locus, 0, _("unknown word `%s'"), | 435 | grecs_error (&entry->locus, 0, _("unknown word: %s"), |
436 | value->v.string); | 436 | value->v.string); |
437 | return 1; | 437 | return 1; |
438 | } | 438 | } |
@@ -540,7 +540,7 @@ component_verify (struct component *comp, grecs_locus_t *locus) | |||
540 | if (!comp->service) | 540 | if (!comp->service) |
541 | /* TRANSLATORS: do not translate quoted words, they are keywords. */ | 541 | /* TRANSLATORS: do not translate quoted words, they are keywords. */ |
542 | COMPERR (grecs_error, | 542 | COMPERR (grecs_error, |
543 | "%s", _("`internal' used without `service'")); | 543 | "%s", _("\"internal\" used without \"service\"")); |
544 | else | 544 | else |
545 | { | 545 | { |
546 | comp->builtin = inetd_builtin_lookup (comp->service, | 546 | comp->builtin = inetd_builtin_lookup (comp->service, |
@@ -552,7 +552,7 @@ component_verify (struct component *comp, grecs_locus_t *locus) | |||
552 | /* TRANSLATORS: do not translate quoted words, they are | 552 | /* TRANSLATORS: do not translate quoted words, they are |
553 | keywords. */ | 553 | keywords. */ |
554 | COMPERR (grecs_error, | 554 | COMPERR (grecs_error, |
555 | "%s", _("`internal' used with `command'")); | 555 | "%s", _("\"internal\" used with \"command\"")); |
556 | } | 556 | } |
557 | } | 557 | } |
558 | else if (!comp->argv) | 558 | else if (!comp->argv) |
@@ -565,11 +565,11 @@ component_verify (struct component *comp, grecs_locus_t *locus) | |||
565 | if ((comp->flags & (CF_TCPMUX | CF_TCPMUXPLUS)) | 565 | if ((comp->flags & (CF_TCPMUX | CF_TCPMUXPLUS)) |
566 | == (CF_TCPMUX | CF_TCPMUXPLUS)) | 566 | == (CF_TCPMUX | CF_TCPMUXPLUS)) |
567 | COMPERR (grecs_error, | 567 | COMPERR (grecs_error, |
568 | "%s", _("both `tcpmux' and `tcpmuxplus' used")); | 568 | "%s", _("both \"tcpmux\" and \"tcpmuxplus\" used")); |
569 | else if (!comp->service) | 569 | else if (!comp->service) |
570 | /* TRANSLATORS: do not translate quoted words, they are keywords. */ | 570 | /* TRANSLATORS: do not translate quoted words, they are keywords. */ |
571 | COMPERR (grecs_error, | 571 | COMPERR (grecs_error, |
572 | "%s", _("`internal' used without `service'")); | 572 | "%s", _("\"internal\" used without \"service\"")); |
573 | } | 573 | } |
574 | 574 | ||
575 | if (comp->pass_fd_socket && comp->mode != pies_comp_pass_fd) | 575 | if (comp->pass_fd_socket && comp->mode != pies_comp_pass_fd) |
@@ -660,7 +660,7 @@ component_verify (struct component *comp, grecs_locus_t *locus) | |||
660 | && comp->redir[RETR_OUT].type != redir_null) | 660 | && comp->redir[RETR_OUT].type != redir_null) |
661 | { | 661 | { |
662 | COMPERR (grecs_error, | 662 | COMPERR (grecs_error, |
663 | "%s", _("stdout translation invalid in this mode")); | 663 | "%s", _("stdout redirection invalid in this mode")); |
664 | comp->redir[RETR_OUT].type = redir_null; | 664 | comp->redir[RETR_OUT].type = redir_null; |
665 | } | 665 | } |
666 | 666 | ||
@@ -1245,7 +1245,7 @@ ctl_accept (int socket, void *data) | |||
1245 | fd = accept (socket, (struct sockaddr*) &addr, &addrlen); | 1245 | fd = accept (socket, (struct sockaddr*) &addr, &addrlen); |
1246 | if (fd == -1) | 1246 | if (fd == -1) |
1247 | { | 1247 | { |
1248 | logmsg (LOG_ERR, _("accept failed: %s"), strerror (errno)); | 1248 | logfuncall ("accept", NULL, errno); |
1249 | return 1; | 1249 | return 1; |
1250 | } | 1250 | } |
1251 | 1251 | ||
@@ -1289,8 +1289,7 @@ ctl_open (void) | |||
1289 | 1289 | ||
1290 | if (listen (fd, 8)) | 1290 | if (listen (fd, 8)) |
1291 | { | 1291 | { |
1292 | logmsg (LOG_CRIT, _("can't listen on control socket %s: %s"), | 1292 | logfuncall ("listen", control.url->string, errno); |
1293 | control.url->string, strerror (errno)); | ||
1294 | return -1; | 1293 | return -1; |
1295 | } | 1294 | } |
1296 | 1295 | ||