Use negative return values on errors

This commit is contained in:
Arnout Engelen
2012-03-15 20:53:25 +00:00
parent d7476faae1
commit 2c04ca9267
4 changed files with 7 additions and 7 deletions

View File

@@ -61,11 +61,11 @@ void getLocal (const char *device, bool tracemode)
struct sockaddr_in *saddr;
if((sock=socket(AF_INET, SOCK_RAW, htons(0x0806)))<0){
forceExit("creating socket failed while establishing local IP - are you root?");
forceExit("creating socket failed while establishing local IP - are you root?", -3);
}
strcpy(iFreq.ifr_name, device);
if(ioctl(sock, SIOCGIFADDR, &iFreq)<0){
forceExit("ioctl failed while establishing local IP for selected device %s. You may specify the device on the command line.", device);
forceExit("ioctl failed while establishing local IP for selected device %s. You may specify the device on the command line.", -4, device);
}
saddr=(struct sockaddr_in*)&iFreq.ifr_addr;
local_addrs = new local_addr (saddr->sin_addr.s_addr, local_addrs);