diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2018-11-09 14:38:44 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2018-11-09 14:40:49 +0200 |
commit | 67eb1f4c05ec5fafec7ec7745575a8213734f134 (patch) | |
tree | 68a490c2d2dae0f9d079fc81a10c203fc01cc5ef /src | |
parent | 08204cb140768a2963a90c6a20ddb9c6da95695f (diff) | |
download | mailfromd-67eb1f4c05ec5fafec7ec7745575a8213734f134.tar.gz mailfromd-67eb1f4c05ec5fafec7ec7745575a8213734f134.tar.bz2 |
Document debug categories. Fix improper use of decimal constants instead of MU_DEBUG_TRACE identifiers
Diffstat (limited to 'src')
-rw-r--r-- | src/builtin/io.bi | 16 | ||||
-rw-r--r-- | src/builtin/mbox.bi | 2 | ||||
-rw-r--r-- | src/builtin/other.bi | 2 | ||||
-rw-r--r-- | src/builtin/sa.bi | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/src/builtin/io.bi b/src/builtin/io.bi index d1512ad8..3e84bb52 100644 --- a/src/builtin/io.bi +++ b/src/builtin/io.bi @@ -174,13 +174,13 @@ stderr_to_log(char *arg, const char *cmd) mu_error(_("unknown syslog priority (%s), " "redirecting stderr to %s"), arg, mu_syslog_priority_to_string(pri)); } } - MF_DEBUG(10, + MF_DEBUG(MU_DEBUG_TRACE2, ("redirecting stderr to syslog %s.%s", mu_syslog_facility_to_string(fac), mu_syslog_priority_to_string(pri))); len = strcspn(cmd, " \t"); tag = malloc(LOG_TAG_PFX_LEN + len + 1); @@ -228,13 +228,13 @@ stderr_handler(int mode, char *arg, const char *cmd) append = O_APPEND; case STDERR_FILE: if (!arg || !*arg) { close(2); break; } - MF_DEBUG(10, ("redirecting stderr to %s", arg)); + MF_DEBUG(MU_DEBUG_TRACE2, ("redirecting stderr to %s", arg)); fd = open(arg, O_CREAT|O_WRONLY|append, 0644); if (fd < 0) { mu_error(_("cannot open file %s for appending: %s"), arg, mu_strerror(errno)); close(2); return; @@ -358,13 +358,13 @@ open_program_stream_ioe(eval_environ_t env, else stderr_handler(err, arg, cmdline); /* Close unneded descripitors */ close_fds_above(2); - MF_DEBUG(10, ("running %s", cmdline)); + MF_DEBUG(MU_DEBUG_TRACE3, ("running %s", cmdline)); if (mu_wordsplit(cmdline, &ws, MU_WRDSF_DEFFLAGS & ~MU_WRDSF_CESCAPES)) { mu_error(_("cannot parse command line %s: %s"), cmdline, mu_wordsplit_strerror(&ws)); exit(127); } @@ -713,13 +713,13 @@ MF_DEFUN(open, NUMBER, STRING name) break; } MF_ASSERT(i < nstreams, mfe_failure, _("no more files available")); - MF_DEBUG(10, ("opening stream %s", name)); + MF_DEBUG(MU_DEBUG_TRACE1, ("opening stream %s", name)); iotab[i].name = mu_strdup(name); iotab[i].delim = NULL; if (*name == '>') { flags |= O_RDWR|O_CREAT; name++; if (*name == '>') { @@ -751,13 +751,13 @@ MF_DEFUN(open, NUMBER, STRING name) rc = opf(env, &iotab[i], name, flags); MF_ASSERT(rc == 0, mfe_failure, _("cannot open stream %s: %s"), name, mu_strerror(rc)); - MF_DEBUG(10, ("open(%s) = %d", name, i)); + MF_DEBUG(MU_DEBUG_TRACE1, ("open(%s) = %d", name, i)); MF_RETURN(i); } END MF_DEFUN(spawn, NUMBER, STRING name, OPTIONAL, NUMBER fin, NUMBER fout, NUMBER ferr) @@ -772,13 +772,13 @@ MF_DEFUN(spawn, NUMBER, STRING name, OPTIONAL, break; } MF_ASSERT(i < nstreams, mfe_failure, _("no more files available")); - MF_DEBUG(10, ("spawning %s", name)); + MF_DEBUG(MU_DEBUG_TRACE1, ("spawning %s", name)); iotab[i].name = mu_strdup(name); iotab[i].delim = NULL; flags = O_WRONLY; if (*name == '|') name++; @@ -809,13 +809,13 @@ MF_DEFUN(spawn, NUMBER, STRING name, OPTIONAL, rc = open_program_stream_ioe(env, &iotab[i], name, flags, ioe); MF_ASSERT(rc == 0, mfe_failure, _("cannot open stream %s: %s"), name, mu_strerror(rc)); - MF_DEBUG(10, ("spawn(%s) = %d", name, i)); + MF_DEBUG(MU_DEBUG_TRACE1, ("spawn(%s) = %d", name, i)); MF_RETURN(i); } END MF_DSEXP @@ -919,13 +919,13 @@ END MF_DEFUN(write, VOID, NUMBER fd, STRING str, OPTIONAL, NUMBER n) { struct io_stream *iotab = MF_GET_DATA; int rc; - MF_DEBUG(10, ("writing %s to %lu", str, fd)); + MF_DEBUG(MU_DEBUG_TRACE1, ("writing %s to %lu", str, fd)); MF_ASSERT(fd >= 0 && fd < nstreams && OFD(iotab[fd]) != -1, mfe_range, _("invalid file descriptor")); if (!MF_DEFINED(n)) n = strlen (str); rc = write(OFD(iotab[fd]), str, n); diff --git a/src/builtin/mbox.bi b/src/builtin/mbox.bi index df4f3ec2..27f74628 100644 --- a/src/builtin/mbox.bi +++ b/src/builtin/mbox.bi @@ -86,13 +86,13 @@ MF_DEFUN(mailbox_open, NUMBER, STRING url, OPTIONAL, STRING mode, STRING perms) char *p; md = find_slot(mbtab); MF_ASSERT(md >= 0, mfe_failure, _("no more mailboxes available")); - MF_DEBUG(10, ("opening mailbox %s", url)); + MF_DEBUG(MU_DEBUG_TRACE1, ("opening mailbox %s", url)); mp = mbtab + md; flags = 0; for (p = MF_OPTVAL(mode, "r"); *p; p++) { switch (*p) { case 'a': diff --git a/src/builtin/other.bi b/src/builtin/other.bi index 5063885e..bdb21b00 100644 --- a/src/builtin/other.bi +++ b/src/builtin/other.bi @@ -45,13 +45,13 @@ valid_user_p(eval_environ_t env, const char *name) MF_THROW(mfe_failure, _("failure querying for username %s"), name); break; } - MF_DEBUG(10, + MF_DEBUG(MU_DEBUG_TRACE1, ("Checking user %s: %s", name, rc ? "true" : "false")); return rc; } MF_DEFUN(validuser, NUMBER, STRING name) { diff --git a/src/builtin/sa.bi b/src/builtin/sa.bi index fd3fa0b7..6225829f 100644 --- a/src/builtin/sa.bi +++ b/src/builtin/sa.bi @@ -571,13 +571,13 @@ MF_DEFUN(clamav, NUMBER, NUMBER nmsg, STRING urlstr) if (!s) s = buffer; else s++; MF_VAR_SET_STRING(clamav_virus_name, s); - MF_DEBUG(2, + MF_DEBUG(MU_DEBUG_TRACE1, ("%sclamav found %s", mailfromd_msgid(env_get_context(env)), s)); rc = 1; } else if (strncmp(p, "ERROR", 5) == 0) { /* FIXME: mf code */ MF_THROW(mfe_failure, _("clamav error: %s"), buffer); |