diff options
author | June McEnroe <june@causal.agency> | 2018-05-13 00:41:58 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2018-05-13 00:42:28 -0400 |
commit | 95b7adbdb6c77c80dfc59b4e370d7a1fae8e4d5e (patch) | |
tree | 3f662ee90a926af6b521e8260e720f66d850a0cc /bin/wake.c | |
parent | Tabify shell scripts (diff) | |
download | src-95b7adbdb6c77c80dfc59b4e370d7a1fae8e4d5e.tar.gz src-95b7adbdb6c77c80dfc59b4e370d7a1fae8e4d5e.zip |
Tabify bin
Diffstat (limited to '')
-rw-r--r-- | bin/wake.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/bin/wake.c b/bin/wake.c index c81c5ede..7c4496da 100644 --- a/bin/wake.c +++ b/bin/wake.c @@ -25,29 +25,29 @@ #define MAC 0x04, 0x7D, 0x7B, 0xD5, 0x6A, 0x53 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, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + MAC, MAC, MAC, MAC, MAC, MAC, MAC, MAC, + MAC, MAC, MAC, MAC, MAC, MAC, MAC, MAC, }; int main() { - int sock = socket(PF_INET, SOCK_DGRAM, 0); - if (sock < 0) err(EX_OSERR, "socket"); + int sock = socket(PF_INET, SOCK_DGRAM, 0); + if (sock < 0) err(EX_OSERR, "socket"); - int on = 1; - int error = setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)); - if (error) err(EX_OSERR, "setsockopt"); + int on = 1; + int error = setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)); + if (error) err(EX_OSERR, "setsockopt"); - struct sockaddr_in addr = { - .sin_family = AF_INET, - .sin_port = 9, - .sin_addr.s_addr = INADDR_BROADCAST, - }; - ssize_t size = sendto( - sock, payload, sizeof(payload), 0, - (struct sockaddr *)&addr, sizeof(addr) - ); - if (size < 0) err(EX_IOERR, "sendto"); + struct sockaddr_in addr = { + .sin_family = AF_INET, + .sin_port = 9, + .sin_addr.s_addr = INADDR_BROADCAST, + }; + ssize_t size = sendto( + sock, payload, sizeof(payload), 0, + (struct sockaddr *)&addr, sizeof(addr) + ); + if (size < 0) err(EX_IOERR, "sendto"); - return EX_OK; + return EX_OK; } |