carl9170 firmware tools: wol stop after inject error
authorChristian Lamparter <chunkeey@googlemail.com>
Sun, 16 Jan 2011 14:16:06 +0000 (15:16 +0100)
committerChristian Lamparter <chunkeey@googlemail.com>
Sun, 16 Jan 2011 14:16:06 +0000 (15:16 +0100)
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
tools/src/wol.c

index f2c95d83d2aef53210ee2ec7aa91c67b3fb860c4..640380625e1ef5c1654f1f61d4556636eece7f96 100644 (file)
@@ -193,10 +193,12 @@ int main(int argc, char **args)
 
        while (num--) {
                err = inject_frame(sock, wol_magic_tmpl, sizeof(wol_magic_tmpl));
-               if (err < 0)
+               if (err < 0) {
                        fprintf(stderr, "failed to send WOL packet.\n");
-               else if (verbose)
+                       break;
+               } else if (verbose) {
                        fprintf(stdout, "WOL packet sent.\n");
+               }
        }
 
        close(sock);