Exit with proper status when wake() fails.
PR: bin/153527 Submitted by: Douglas Steinwand MFC after: 2 weeks
This commit is contained in:
parent
638d371d49
commit
650071cf2c
@ -183,7 +183,7 @@ send_wakeup(int bpf, struct ether_addr const *addr)
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
int bpf, n;
|
||||
int bpf, n, rval;
|
||||
char ifname[IF_NAMESIZE];
|
||||
|
||||
if (argc < 2)
|
||||
@ -204,10 +204,13 @@ main(int argc, char *argv[])
|
||||
|
||||
if (n >= argc)
|
||||
usage();
|
||||
for (; n < argc; n++)
|
||||
if (wake(bpf, argv[n]))
|
||||
rval = 0;
|
||||
for (; n < argc; n++) {
|
||||
if (wake(bpf, argv[n]) != 0) {
|
||||
rval = 1;
|
||||
warn("Cannot send Wake on LAN frame over `%s' to `%s'",
|
||||
ifname, argv[n]);
|
||||
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
exit(rval);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user