ref: 09d69e04b92870e09de5df73fafb7c1d5bf99369
parent: f384231c607989e0dfa51da2fcce925ccd7f89ae
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Aug 25 15:49:09 EDT 2024
libc: cleanup hangup() function (avoid duplicated literal string)
--- a/sys/src/libc/port/hangup.c
+++ b/sys/src/libc/port/hangup.c
@@ -8,5 +8,6 @@
int
hangup(int ctl)
{
- return write(ctl, "hangup", sizeof("hangup")-1) != sizeof("hangup")-1;
+ static char msg[] = "hangup";
+ return write(ctl, msg, sizeof(msg)-1) != sizeof(msg)-1;
}
--
⑨