/[anubis]/anubis/src/errs.c
ViewVC logotype

Diff of /anubis/src/errs.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by gray, Sun Aug 17 15:37:04 2003 UTC revision 1.7 by polak, Thu Aug 21 19:37:33 2003 UTC
# Line 26  Line 26 
26  #include "extern.h"  #include "extern.h"
27    
28  void  void
29  anubis_error(int method, char *format, ...)  anubis_error(int method, const char *fmt, ...)
30  {  {
31          va_list arglist;          va_list arglist;
32    
# Line 34  anubis_error(int method, char *format, . Line 34  anubis_error(int method, char *format, .
34          case HARD:          case HARD:
35                  topt |= T_ERROR;                  topt |= T_ERROR;
36                  break;                  break;
                   
37          case SOFT:          case SOFT:
38          case SYNTAX:          case SYNTAX:
39                  topt &= ~T_ERROR;                  topt &= ~T_ERROR;
# Line 43  anubis_error(int method, char *format, . Line 42  anubis_error(int method, char *format, .
42    
43          if (topt & T_SMTP_ERROR_CODES) {          if (topt & T_SMTP_ERROR_CODES) {
44                  fprintf(stdout, "451 4.0.0 ");                  fprintf(stdout, "451 4.0.0 ");
45                  va_start(arglist, format);                  va_start(arglist, fmt);
46                  vfprintf(stdout, format, arglist);                  vfprintf(stdout, fmt, arglist);
47                  va_end(arglist);                  va_end(arglist);
48                  fprintf(stdout, "\n");                  fputc('\n', stdout);
49                                    
50          } else if (options.termlevel != SILENT) {          }
51            else if (options.termlevel != SILENT) {
52                  char txt[LINEBUFFER+1];                  char txt[LINEBUFFER+1];
53                    
54                  va_start(arglist, format);                  va_start(arglist, fmt);
55                  vsnprintf(txt, LINEBUFFER, format, arglist);                  vsnprintf(txt, LINEBUFFER, fmt, arglist);
56                  va_end(arglist);                  va_end(arglist);
57  #ifdef HAVE_SYSLOG  #ifdef HAVE_SYSLOG
58                  if ((topt & T_DAEMON) && !(topt & T_FOREGROUND)) {                  if ((topt & T_DAEMON) && !(topt & T_FOREGROUND)) {
# Line 78  anubis_error(int method, char *format, . Line 78  anubis_error(int method, char *format, .
78          errno = 0;          errno = 0;
79          if (method != SYNTAX && !(topt & T_DAEMON) && !(topt & T_FOREGROUND))          if (method != SYNTAX && !(topt & T_DAEMON) && !(topt & T_FOREGROUND))
80                  quit(EXIT_FAILURE);                  quit(EXIT_FAILURE);
         return;  
81  }  }
82    
83  void  void
# Line 86  socket_error(const char *msg) Line 85  socket_error(const char *msg)
85  {  {
86          anubis_error(HARD, _("Couldn't write to socket: %s."),          anubis_error(HARD, _("Couldn't write to socket: %s."),
87                       msg ? msg : strerror(errno));                       msg ? msg : strerror(errno));
         return;  
88  }  }
89    
90  void  void
91  socks_error(char *txt)  socks_error(const char *msg)
92  {  {
93          anubis_error(HARD, _("SOCKS proxy: %s"), txt);          anubis_error(HARD, _("SOCKS proxy: %s"), msg);
         return;  
94  }  }
95    
96  void  void

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26