ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/ircd.c
(Generate patch)

Comparing ircd-hybrid-7.3/src/ircd.c (file contents):
Revision 1114 by michael, Sun Nov 8 13:10:50 2009 UTC vs.
Revision 1115 by michael, Tue Dec 21 14:42:54 2010 UTC

# Line 583 | Line 583 | main(int argc, char *argv[])
583    init_auth();          /* Initialise the auth code */
584    init_resolver();      /* Needs to be setup before the io loop */
585    read_conf_files(1);   /* cold start init conf files */
586  me.id[0] = '\0';
586    init_uid();
587    initialize_server_capabs();   /* Set up default_server_capabs */
588    initialize_global_set_options();
589    init_channels();
590  
591 <  if (ServerInfo.name == NULL)
591 >  if (EmptyString(ServerInfo.sid))
592    {
593 <    ilog(L_CRIT, "No server name specified in serverinfo block.");
593 >    ilog(L_CRIT, "ERROR: No server id specified in serverinfo block.");
594 >    exit(EXIT_FAILURE);
595 >  }
596 >
597 >  strlcpy(me.id, ServerInfo.sid, sizeof(me.id));
598 >
599 >  if (EmptyString(ServerInfo.name))
600 >  {
601 >    ilog(L_CRIT, "ERROR: No server name specified in serverinfo block.");
602      exit(EXIT_FAILURE);
603    }
604  
605    strlcpy(me.name, ServerInfo.name, sizeof(me.name));
606  
607    /* serverinfo{} description must exist.  If not, error out.*/
608 <  if (ServerInfo.description == NULL)
608 >  if (EmptyString(ServerInfo.description))
609    {
610 <    ilog(L_CRIT,
604 <      "ERROR: No server description specified in serverinfo block.");
610 >    ilog(L_CRIT, "ERROR: No server description specified in serverinfo block.");
611      exit(EXIT_FAILURE);
612    }
613  
# Line 614 | Line 620 | main(int argc, char *argv[])
620    make_server(&me);
621  
622    me.lasttime = me.since = me.firsttime = CurrentTime;
623 +
624 +  hash_add_id(&me);
625    hash_add_client(&me);
626    
627    /* add ourselves to global_serv_list */
# Line 622 | Line 630 | main(int argc, char *argv[])
630   #ifndef STATIC_MODULES
631    if (chdir(MODPATH))
632    {
633 <    ilog (L_CRIT, "Could not load core modules. Terminating!");
633 >    ilog(L_CRIT, "Could not load core modules. Terminating!");
634      exit(EXIT_FAILURE);
635    }
636  
637    load_all_modules(1);
638    load_conf_modules();
639    load_core_modules(1);
640 +
641    /* Go back to DPATH after checking to see if we can chdir to MODPATH */
642 <  chdir(ConfigFileEntry.dpath);
642 >  if (chdir(ConfigFileEntry.dpath))
643 >  {
644 >    perror("chdir");
645 >    exit(EXIT_FAILURE);
646 >  }
647   #else
648    load_all_modules(1);
649   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)