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

Comparing ircd-hybrid-8/src/ircd.c (file contents):
Revision 1316 by michael, Tue Mar 27 17:05:51 2012 UTC vs.
Revision 1361 by michael, Sun Apr 22 19:01:51 2012 UTC

# Line 72 | Line 72 | struct server_info ServerInfo;
72   struct admin_info AdminInfo = { NULL, NULL, NULL };
73   struct Counter Count = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
74   struct ServerState_t server_state = { 0 };
75 < struct logging_entry ConfigLoggingEntry = { 1, 1 };
75 > struct logging_entry ConfigLoggingEntry = { .use_logging = 1 };
76   struct ServerStatistics ServerStats;
77   struct timeval SystemTime;
78   struct Client me;             /* That's me */
# Line 142 | Line 142 | make_daemon(void)
142  
143   static int printVersion = 0;
144  
145 < struct lgetopt myopts[] = {
145 > static struct lgetopt myopts[] = {
146    {"dlinefile",  &ConfigFileEntry.dlinefile,
147     STRING, "File to use for dline.conf"},
148    {"configfile", &ConfigFileEntry.configfile,
# Line 336 | Line 336 | initialize_server_capabs(void)
336   static void
337   write_pidfile(const char *filename)
338   {
339 <  FBFILE *fb;
339 >  FILE *fb;
340  
341 <  if ((fb = fbopen(filename, "w")))
341 >  if ((fb = fopen(filename, "w")))
342    {
343      char buff[32];
344      unsigned int pid = (unsigned int)getpid();
345    size_t nbytes = snprintf(buff, sizeof(buff), "%u\n", pid);
345  
346 <    if ((fbputs(buff, fb, nbytes) == -1))
346 >    snprintf(buff, sizeof(buff), "%u\n", pid);
347 >
348 >    if ((fputs(buff, fb) == -1))
349        ilog(LOG_TYPE_IRCD, "Error writing %u to pid file %s (%s)",
350             pid, filename, strerror(errno));
351  
352 <    fbclose(fb);
352 <    return;
352 >    fclose(fb);
353    }
354    else
355    {
# Line 368 | Line 368 | write_pidfile(const char *filename)
368   static void
369   check_pidfile(const char *filename)
370   {
371 <  FBFILE *fb;
371 >  FILE *fb;
372    char buff[32];
373    pid_t pidfromfile;
374  
375    /* Don't do logging here, since we don't have log() initialised */
376 <  if ((fb = fbopen(filename, "r")))
376 >  if ((fb = fopen(filename, "r")))
377    {
378 <    if (fbgets(buff, 20, fb) == NULL)
378 >    if (fgets(buff, 20, fb) == NULL)
379      {
380        /* log(L_ERROR, "Error reading from pid file %s (%s)", filename,
381         * strerror(errno));
# Line 393 | Line 393 | check_pidfile(const char *filename)
393        }
394      }
395  
396 <    fbclose(fb);
396 >    fclose(fb);
397    }
398    else if (errno != ENOENT)
399    {
# Line 563 | Line 563 | main(int argc, char *argv[])
563    init_hash();
564    init_ip_hash_table();      /* client host ip hash table */
565    init_host_hash();          /* Host-hashtable. */
566  clear_tree_parse();
566    init_client();
567    init_class();
568 <  init_whowas();
568 >  whowas_init();
569    watch_init();
570    init_auth();          /* Initialise the auth code */
571    init_resolver();      /* Needs to be setup before the io loop */

Diff Legend

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