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

Diff of /imapfilter/imapfilter.c

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

revision 1.59 by lefcha, Sat Feb 7 23:54:16 2004 UTC revision 1.60 by lefcha, Mon Feb 9 17:34:56 2004 UTC
# Line 63  main(int argc, char *argv[]) Line 63  main(int argc, char *argv[])
63          conffile = NULL;          conffile = NULL;
64          connpri.sock = connaux.sock = -1;          connpri.sock = connaux.sock = -1;
65    
66          while ((c = getopt(argc, argv, "c:d:hkl:"          while ((c = getopt(argc, argv, "c:d:Dhkl:"
67  #ifdef ENCRYPTED_PASSWORDS  #ifdef ENCRYPTED_PASSWORDS
68                      "p"                      "p"
69  #endif  #endif
# Line 79  main(int argc, char *argv[]) Line 79  main(int argc, char *argv[])
79                          if (errno)                          if (errno)
80                                  interval = 0;                                  interval = 0;
81                          break;                          break;
82                    case 'D':
83                            options |= OPTION_DEBUG;
84                            break;
85                  case 'h':                  case 'h':
86                          usage();                          usage();
87                          exit(ERROR_UNDEFINED);                          exit(ERROR_UNDEFINED);
# Line 115  main(int argc, char *argv[]) Line 118  main(int argc, char *argv[])
118                  }                  }
119          }          }
120    
121            debug_start();
122    
123          create_homedir();          create_homedir();
124    
125          lockfile_check();          lockfile_check();
126          lockfile_create();          lockfile_create();
127    
128  #ifndef DEBUG          if (!(options & OPTION_DEBUG))
129          corefile_disable();                  corefile_disable();
 #endif  
130    
131          tty_store();          tty_store();
132          catch_signals();          catch_signals();
# Line 142  main(int argc, char *argv[]) Line 146  main(int argc, char *argv[])
146          }          }
147  #endif  #endif
148    
149          open_logfile();          log_start();
150    
151          init_buffer(&ibuf);          init_buffer(&ibuf);
152          init_buffer(&obuf);          init_buffer(&obuf);
# Line 164  main(int argc, char *argv[]) Line 168  main(int argc, char *argv[])
168    
169                          r = greeting_response(&connpri);                          r = greeting_response(&connpri);
170    
171  #ifdef DEBUG                          if (options & OPTION_DEBUG)
172                          test(&connpri);                                  test(&connpri);
 #endif  
173    
174                          if (check_capabilities(&connpri))                          if (check_capabilities(&connpri))
175                                  continue;                                  continue;
# Line 220  main(int argc, char *argv[]) Line 223  main(int argc, char *argv[])
223                  if (options & OPTION_DAEMON_MODE &&                  if (options & OPTION_DAEMON_MODE &&
224                      !(flags & FLAG_DAEMON_MODE)) {                      !(flags & FLAG_DAEMON_MODE)) {
225    
                         close_logfile();  
   
226                          switch (fork()) {                          switch (fork()) {
227                          case -1:                          case -1:
228                                  fatal(ERROR_FORK, "forking; %s\n",                                  fatal(ERROR_FORK, "forking; %s\n",
# Line 230  main(int argc, char *argv[]) Line 231  main(int argc, char *argv[])
231                          case 0:                          case 0:
232                                  break;                                  break;
233                          default:                          default:
234                                    log_stop();
235                                  secmem_clear();                                  secmem_clear();
236                                    debug_stop();
237                                  exit(0);                                  exit(0);
238                                  break;                                  break;
239                          }                          }
# Line 247  main(int argc, char *argv[]) Line 250  main(int argc, char *argv[])
250                          case 0:                          case 0:
251                                  break;                                  break;
252                          default:                          default:
253                                    log_stop();
254                                  secmem_clear();                                  secmem_clear();
255                                    debug_stop();
256                                  exit(0);                                  exit(0);
257                                  break;                                  break;
258                          }                          }
# Line 259  main(int argc, char *argv[]) Line 264  main(int argc, char *argv[])
264                                  dup(STDIN_FILENO);                                  dup(STDIN_FILENO);
265                                  dup(STDIN_FILENO);                                  dup(STDIN_FILENO);
266                          }                          }
                         open_logfile();  
267                          lockfile_create();                          lockfile_create();
268                          corefile_disable();                          corefile_disable();
269    
# Line 274  main(int argc, char *argv[]) Line 278  main(int argc, char *argv[])
278                          sleep(interval);                          sleep(interval);
279          } while (options & OPTION_DAEMON_MODE && interval);          } while (options & OPTION_DAEMON_MODE && interval);
280    
281            log_stop();
282          secmem_clear();          secmem_clear();
         close_logfile();  
283    
284          lockfile_remove();          lockfile_remove();
285    
286            debug_stop();
287    
288          exit(0);          exit(0);
289  }  }
290    
# Line 290  void Line 296  void
296  usage(void)  usage(void)
297  {  {
298          fprintf(stderr,          fprintf(stderr,
299              "usage: imapfilter [-hk"              "usage: imapfilter [-bDhk"
300  #ifdef ENCRYPTED_PASSWORDS  #ifdef ENCRYPTED_PASSWORDS
301              "p"              "p"
302  #endif  #endif

Legend:
Removed from v.1.59  
changed lines
  Added in v.1.60

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26