Date: Sat, 10 Mar 2012 08:27:37 +0000 (UTC) From: Jaakko Heinonen <jh@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r232775 - stable/9/usr.sbin/wake Message-ID: <201203100827.q2A8Rbwi047410@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jh Date: Sat Mar 10 08:27:37 2012 New Revision: 232775 URL: http://svn.freebsd.org/changeset/base/232775 Log: MFC r232102: Exit with proper status when wake() fails. PR: bin/153527 Modified: stable/9/usr.sbin/wake/wake.c Directory Properties: stable/9/usr.sbin/wake/ (props changed) Modified: stable/9/usr.sbin/wake/wake.c ============================================================================== --- stable/9/usr.sbin/wake/wake.c Sat Mar 10 08:25:49 2012 (r232774) +++ stable/9/usr.sbin/wake/wake.c Sat Mar 10 08:27:37 2012 (r232775) @@ -183,7 +183,7 @@ send_wakeup(int bpf, struct ether_addr c 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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203100827.q2A8Rbwi047410>