/[svn]/ircd-hybrid-7.2/src/ircd.c
ViewVC logotype

Diff of /ircd-hybrid-7.2/src/ircd.c

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

revision 1000 by michael, Sun Aug 23 12:43:17 2009 UTC revision 1001 by michael, Sat Aug 29 22:44:44 2009 UTC
# Line 123  unsigned int split_servers; Line 123  unsigned int split_servers;
123  int rehashed_klines = 0;  int rehashed_klines = 0;
124    
125    
 #ifndef _WIN32  
126  /*  /*
127   * print_startup - print startup information   * print_startup - print startup information
128   */   */
# Line 154  make_daemon(void) Line 153  make_daemon(void)
153    
154    setsid();    setsid();
155  }  }
 #endif  
156    
157  static int printVersion = 0;  static int printVersion = 0;
158    
# Line 184  set_time(void) Line 182  set_time(void)
182  {  {
183    static char to_send[200];    static char to_send[200];
184    struct timeval newtime;    struct timeval newtime;
 #ifdef _WIN32  
   FILETIME ft;  
   
   GetSystemTimeAsFileTime(&ft);  
   if (ft.dwLowDateTime < 0xd53e8000)  
     ft.dwHighDateTime--;  
   ft.dwLowDateTime -= 0xd53e8000;  
   ft.dwHighDateTime -= 0x19db1de;  
   
   newtime.tv_sec  = (*(uint64_t *) &ft) / 10000000;  
   newtime.tv_usec = (*(uint64_t *) &ft) / 10 % 1000000;  
 #else  
185    newtime.tv_sec  = 0;    newtime.tv_sec  = 0;
186    newtime.tv_usec = 0;    newtime.tv_usec = 0;
187    
# Line 208  set_time(void) Line 194  set_time(void)
194                           strerror(errno));                           strerror(errno));
195      restart("Clock Failure");      restart("Clock Failure");
196    }    }
 #endif  
197    
198    if (newtime.tv_sec < CurrentTime)    if (newtime.tv_sec < CurrentTime)
199    {    {
# Line 400  write_pidfile(const char *filename) Line 385  write_pidfile(const char *filename)
385  static void  static void
386  check_pidfile(const char *filename)  check_pidfile(const char *filename)
387  {  {
 #ifndef _WIN32  
388    FBFILE *fb;    FBFILE *fb;
389    char buff[32];    char buff[32];
390    pid_t pidfromfile;    pid_t pidfromfile;
# Line 432  check_pidfile(const char *filename) Line 416  check_pidfile(const char *filename)
416    {    {
417      /* log(L_ERROR, "Error opening pid file %s", filename); */      /* log(L_ERROR, "Error opening pid file %s", filename); */
418    }    }
 #endif  
419  }  }
420    
421  /* setup_corefile()  /* setup_corefile()
# Line 508  main(int argc, char *argv[]) Line 491  main(int argc, char *argv[])
491    /* Check to see if the user is running    /* Check to see if the user is running
492     * us as root, which is a nono     * us as root, which is a nono
493     */     */
 #ifndef _WIN32  
494    if (geteuid() == 0)    if (geteuid() == 0)
495    {    {
496      fprintf(stderr, "Don't run ircd as root!!!\n");      fprintf(stderr, "Don't run ircd as root!!!\n");
# Line 517  main(int argc, char *argv[]) Line 499  main(int argc, char *argv[])
499    
500    /* Setup corefile size immediately after boot -kre */    /* Setup corefile size immediately after boot -kre */
501    setup_corefile();    setup_corefile();
 #endif  
502    
503    /* save server boot time right away, so getrusage works correctly */    /* save server boot time right away, so getrusage works correctly */
504    set_time();    set_time();
# Line 566  main(int argc, char *argv[]) Line 547  main(int argc, char *argv[])
547    
548    init_ssl();    init_ssl();
549    
 #ifndef _WIN32  
550    if (!server_state.foreground)    if (!server_state.foreground)
551    {    {
552      make_daemon();      make_daemon();
# Line 576  main(int argc, char *argv[]) Line 556  main(int argc, char *argv[])
556      print_startup(getpid());      print_startup(getpid());
557    
558    setup_signals();    setup_signals();
 #endif  
559    
560    get_ircd_platform(ircd_platform);    get_ircd_platform(ircd_platform);
561    

Legend:
Removed from v.1000  
changed lines
  Added in v.1001

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28