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 1324 by michael, Fri Mar 30 21:40:38 2012 UTC vs.
Revision 1325 by michael, Sat Mar 31 10:29:02 2012 UTC

# 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    {

Diff Legend

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