ref: 1c738e2a16487b42a030e4b71c3caaad9c7eb446
parent: 8bf1e5b77521d94876a58989a434ef1a08d6d509
author: cinap_lenrek <[email protected]>
date: Sun Dec 18 17:10:50 EST 2022
ndb/dns: procgetname(): use /proc instead of #p
--- a/sys/src/cmd/ndb/dnresolve.c
+++ b/sys/src/cmd/ndb/dnresolve.c
@@ -75,8 +75,8 @@
char *lp, *rp;
char buf[256];
- snprint(buf, sizeof buf, "#p/%d/args", getpid());
- if((fd = open(buf, OREAD)) < 0)
+ snprint(buf, sizeof buf, "/proc/%d/args", getpid());
+ if((fd = open(buf, OREAD|OCEXEC)) < 0)
return strdup("");
*buf = '\0';
n = read(fd, buf, sizeof buf-1);