summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2022-12-18 22:26:54 +0000
committercinap_lenrek <cinap_lenrek@felloff.net>2022-12-18 22:26:54 +0000
commit1d748edeaf62b2e919db1d2d5f0066dd529ea5fa (patch)
treecacc00419b9f904edbc07602da6ff25e063d61f8
parentbcde2519e2031396fef161416d66695861c3527f (diff)
scram, aux/acpi: open /proc/$pid/ctl instead of #p/$pid/ctl for wirecpu0()
-rw-r--r--sys/src/cmd/aux/acpi.c9
-rw-r--r--sys/src/cmd/scram.c9
2 files changed, 6 insertions, 12 deletions
diff --git a/sys/src/cmd/aux/acpi.c b/sys/src/cmd/aux/acpi.c
index 62e33122a..dc362cfc6 100644
--- a/sys/src/cmd/aux/acpi.c
+++ b/sys/src/cmd/aux/acpi.c
@@ -248,15 +248,12 @@ tmpread(char *s, char *e)
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);
}
diff --git a/sys/src/cmd/scram.c b/sys/src/cmd/scram.c
index 32d4bc389..e5dd45f51 100644
--- a/sys/src/cmd/scram.c
+++ b/sys/src/cmd/scram.c
@@ -114,17 +114,14 @@ wirecpu0(void)
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;