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

Comparing ircd-hybrid/trunk/src/fdlist.c (file contents):
Revision 3589 by michael, Sun May 18 15:24:35 2014 UTC vs.
Revision 3600 by michael, Tue May 20 17:32:55 2014 UTC

# Line 177 | Line 177 | fd_note(fde_t *F, const char *format, ..
177   {
178    va_list args;
179  
180 <  if (format != NULL)
180 >  if (format)
181    {
182      va_start(args, format);
183      vsnprintf(F->desc, sizeof(F->desc), format, args);
# Line 193 | Line 193 | fd_note(fde_t *F, const char *format, ..
193   void
194   close_standard_fds(void)
195   {
196 <  int i;
197 <
198 <  for (i = 0; i < LOWEST_SAFE_FD; i++)
196 >  for (unsigned int i = 0; i < LOWEST_SAFE_FD; ++i)
197    {
198      close(i);
199 +
200      if (open("/dev/null", O_RDWR) < 0)
201        exit(-1); /* we're hosed if we can't even open /dev/null */
202    }
# Line 206 | Line 205 | close_standard_fds(void)
205   void
206   close_fds(fde_t *one)
207   {
208 <  int i;
209 <  fde_t *F;
211 <
212 <  for (i = 0; i < FD_HASH_SIZE; i++)
213 <    for (F = fd_hash[i]; F != NULL; F = F->hnext)
208 >  for (unsigned int i = 0; i < FD_HASH_SIZE; ++i)
209 >    for (fde_t *F = fd_hash[i]; F != NULL; F = F->hnext)
210        if (F != one)
211          close(F->fd);
212   }

Diff Legend

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