if(monitor.interface_name)
{
- monitor_init(&monitor);
+ if(monitor_init(&monitor))
+ return 1;
if(trigger.command)
- trigger_init(&trigger);
+ if(trigger_init(&trigger))
+ return 1;
}
if(pinger.target_name)
- pinger_init(&pinger);
+ if(pinger_init(&pinger))
+ return 1;
if(!no_daemon && daemon(1, 0)==-1)
+ {
perror("daemon");
+ return 1;
+ }
openlog("netmon", 0, LOG_LOCAL7);
pinger->socket = socket(PF_INET, SOCK_RAW, IPPROTO_ICMP);
if(pinger->socket==-1)
{
- perror("socket");
+ perror("socket(SOCK_RAW)");
return -1;
}