svn commit: r232775 - stable/9/usr.sbin/wake

Jaakko Heinonen jh at FreeBSD.org
Sat Mar 10 08:27:38 UTC 2012


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);
 }


More information about the svn-src-stable-9 mailing list