NSIS-ka
A free C++ implementation of NSIS protocols

Changeset 6766


Ignore:
Timestamp:
Mar 5, 2014, 3:57:18 PM (4 years ago)
Author:
bless@…
Message:
  • get rid of warnings
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ntlp/trunk/src/network_notification_module.cpp

    r5249 r6766  
    6969void NetworkNotificationModule::main_loop(uint32 nr)
    7070{
    71   int accept_fd;
     71  int accept_fd= -1;
    7272  struct sockaddr_un saddr;
    7373
     
    8282    if ((accept_fd = socket(PF_UNIX, SOCK_SEQPACKET, 0)) == -1) {
    8383      DLog(param.name, "Could not create socket: " << strerror(errno));
    84 
     84      accept_fd= -1;
    8585      continue;
    8686    }
     
    9393
    9494      close(accept_fd);
     95      accept_fd= -1;
    9596      continue;
    9697    }
     
    101102
    102103      close(accept_fd);
     104      accept_fd= -1;
    103105      continue;
    104106    }
     
    129131
    130132        close(accept_fd);
     133        accept_fd= -1;
     134
    131135        break;
    132136      }
     
    154158        close(client_fd);
    155159        close(accept_fd);
     160        accept_fd= -1;
     161
    156162        break;
    157163      }
     
    246252  DLog(param.name, "Closing accepting socket " << param.socket);
    247253
    248   close(accept_fd);
     254  if (accept_fd != -1)
     255          close(accept_fd);
    249256  unlink(param.socket.c_str());
    250257}
Note: See TracChangeset for help on using the changeset viewer.