/[imapfilter]/imapfilter/log.c
ViewVC logotype

Diff of /imapfilter/log.c

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

revision 1.5 by lefcha, Thu Aug 23 19:13:15 2001 UTC revision 1.6 by lefcha, Sun Aug 26 01:18:24 2001 UTC
# Line 12  Line 12 
12    
13  extern int options;  extern int options;
14  extern char logfile[PATH_MAX];  extern char logfile[PATH_MAX];
15    
16  static FILE *logfp;             /* Points to logfile. */  static FILE *logfp;             /* Points to logfile. */
17    
18    
19  /*  /*
20   * Print message if in OPTION_DETAILS_VERBOSE mode.   * Prints message if in OPT_DETAILS_VERBOSE mode.
21   */   */
22  void verbose(const char *info, ...)  void verbose(const char *info, ...)
23  {  {
24      va_list args;      va_list args;
25    
26      if (options & OPTION_DETAILS_VERBOSE) {      if (options & OPT_DETAILS_VERBOSE) {
27          va_start(args, info);          va_start(args, info);
28          vprintf(info, args);          vprintf(info, args);
29          va_end(args);          va_end(args);
# Line 53  void error(const char *errmsg, ...) Line 54  void error(const char *errmsg, ...)
54  int open_logfile(void)  int open_logfile(void)
55  {  {
56      if (!(logfile[0]))      if (!(logfile[0]))
57          return SUCCESS;         /* Logging not enabled. */          return 0;               /* Logging not enabled. */
58    
59  #ifdef DEBUG  #ifdef DEBUG
60      printf("debug: logfile: %s\n", logfile);      printf("debug: logfile: %s\n", logfile);
# Line 64  int open_logfile(void) Line 65  int open_logfile(void)
65      if (!logfp) {      if (!logfp) {
66          fprintf(stderr, "imapfilter: opening logfile %s: %s\n",          fprintf(stderr, "imapfilter: opening logfile %s: %s\n",
67                  logfile, strerror(errno));                  logfile, strerror(errno));
68          return FAILURE;          return 1;
69      }      }
70    
71      return SUCCESS;      return 0;
72  }  }
73    
74    
# Line 77  int open_logfile(void) Line 78  int open_logfile(void)
78  int close_logfile(void)  int close_logfile(void)
79  {  {
80      if (!(logfile[0]))      if (!(logfile[0]))
81          return SUCCESS;          return 0;
82      else      else
83          return fclose(logfp);          return fclose(logfp);
84  }  }

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

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26