ref: d8d0125090d60dbe528086956edf816e76e3cc36
parent: f4783b46401f4532714d921ab8a7c1d6a7c3b7ff
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Dec 18 17:26:54 EST 2022
scram, aux/acpi: open /proc/$pid/ctl instead of #p/$pid/ctl for wirecpu0()
--- a/sys/src/cmd/aux/acpi.c
+++ b/sys/src/cmd/aux/acpi.c
@@ -248,15 +248,12 @@
static void
wirecpu0(void)
{
- char buf[128];
+ char buf[32];
int ctl;
snprint(buf, sizeof(buf), "/proc/%d/ctl", getpid());
- if((ctl = open(buf, OWRITE)) < 0){
- snprint(buf, sizeof(buf), "#p/%d/ctl", getpid());
- if((ctl = open(buf, OWRITE)) < 0)
- return;
- }
+ if((ctl = open(buf, OWRITE)) < 0)
+ return;
write(ctl, "wired 0", 7);
close(ctl);
}
--- a/sys/src/cmd/scram.c
+++ b/sys/src/cmd/scram.c
@@ -114,17 +114,14 @@
int ctl;
snprint(buf, sizeof(buf), "/proc/%d/ctl", getpid());
- if((ctl = open(buf, OWRITE)) < 0){
- snprint(buf, sizeof(buf), "#p/%d/ctl", getpid());
- if((ctl = open(buf, OWRITE)) < 0)
- return;
- }
+ if((ctl = open(buf, OWRITE)) < 0)
+ return;
write(ctl, "wired 0", 7);
close(ctl);
}
void
-main()
+main(void)
{
int n;
--
⑨