summaryrefslogtreecommitdiff
path: root/comsat/comsat.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2001-11-05 13:41:08 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2001-11-05 13:41:08 +0000
commite8e71920f6a3c8821427cf9450a8476f6c01411e (patch)
tree58023d63061c581edb169224f90a1b3953a24c8e /comsat/comsat.c
parent65c562120e5066dac3a43de7df4e213e6a21cfec (diff)
downloadmailutils-e8e71920f6a3c8821427cf9450a8476f6c01411e.tar.gz
mailutils-e8e71920f6a3c8821427cf9450a8476f6c01411e.tar.bz2
Use mu_syslog_error_printer. Fixed misplaced if condition.
Diffstat (limited to 'comsat/comsat.c')
-rw-r--r--comsat/comsat.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/comsat/comsat.c b/comsat/comsat.c
index 753c59d69..d4af46cfd 100644
--- a/comsat/comsat.c
+++ b/comsat/comsat.c
@@ -86,7 +86,6 @@ int timeout = 0;
int maxlines = 5;
char hostname[MAXHOSTNAMELEN];
-static int syslog_error_printer (const char *fmt, va_list ap);
static void comsat_init (void);
static void comsat_daemon_init (void);
static void comsat_daemon (int port);
@@ -156,7 +155,7 @@ main(int argc, char **argv)
/* Set up error messaging */
openlog ("gnu-comsat", LOG_PID, LOG_LOCAL1);
- mu_error_set_print (syslog_error_printer);
+ mu_error_set_print (mu_syslog_error_printer);
if (config_file)
read_config (config_file);
@@ -375,7 +374,7 @@ comsat_main (int fd)
/* Parse the buffer */
p = strchr (buffer, '@');
- if (!p && !isspace (*p))
+ if (!p)
{
syslog (LOG_ERR, "malformed input: %s", buffer);
return 1;
@@ -385,14 +384,14 @@ comsat_main (int fd)
offset = strtoul (p, &endp, 0);
switch (*endp)
{
- case ' ':
case 0:
break;
case ':':
path = endp+1;
break;
default:
- syslog (LOG_ERR, "malformed input: %s@%s (near %s)", buffer, p, endp);
+ if (!isspace (*endp))
+ syslog (LOG_ERR, "malformed input: %s@%s (near %s)", buffer, p, endp);
}
if (find_user (buffer, tty) != SUCCESS)
@@ -537,7 +536,7 @@ notify_user (char *user, char *device, char *path, off_t offset)
/* Take care to clear eighth bit, so we won't upset some stupid terminals */
#define LB(c) ((c)&0x7f)
- nlines = maxlines; /*FIXME:configurable*/
+ nlines = maxlines;
if (header_aget_value (header, MU_HEADER_FROM, &p) == 0)
{
fprintf (fp, "From: ");
@@ -658,13 +657,6 @@ change_user (char *user)
setuid (pw->pw_uid);
}
-static int
-syslog_error_printer (const char *fmt, va_list ap)
-{
- vsyslog (LOG_CRIT, fmt, ap);
- return 0;
-}
-
void
help ()
{

Return to:

Send suggestions and report system problems to the System administrator.