summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-02-23 17:51:22 -0500
committerJune McEnroe <june@causal.agency>2018-02-23 17:51:22 -0500
commit7ca9ce9defde19d4cc77709d4545680d13366908 (patch)
treeecca328fe33e0f83ffd2e976f4de65974639f4eb
parentAvoid unnecessary FDs in errors (diff)
downloadsrc-7ca9ce9defde19d4cc77709d4545680d13366908.tar.gz
src-7ca9ce9defde19d4cc77709d4545680d13366908.zip
Clean up wake
-rw-r--r--bin/wake.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/bin/wake.c b/bin/wake.c
index c9bc40c3..3cfb5b38 100644
--- a/bin/wake.c
+++ b/bin/wake.c
@@ -24,8 +24,7 @@
 #include <sysexits.h>
 
 #define MAC 0x04, 0x7D, 0x7B, 0xD5, 0x6A, 0x53
-
-const uint8_t payload[] = {
+static const uint8_t payload[102] = {
     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
     MAC, MAC, MAC, MAC, MAC, MAC, MAC, MAC,
     MAC, MAC, MAC, MAC, MAC, MAC, MAC, MAC,
@@ -44,12 +43,11 @@ int main() {
         .sin_port = 9,
         .sin_addr.s_addr = INADDR_BROADCAST,
     };
-
-    ssize_t len = sendto(
+    ssize_t size = sendto(
         sock, payload, sizeof(payload), 0,
         (struct sockaddr *)&addr, sizeof(addr)
     );
-    if (len < 0) err(EX_IOERR, "sendto");
+    if (size < 0) err(EX_IOERR, "sendto");
 
     return EX_OK;
 }