summaryrefslogtreecommitdiff
path: root/sys/src/ape/lib/ap/plan9/_envsetup.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2012-12-03 18:47:41 +0100
committercinap_lenrek <cinap_lenrek@gmx.de>2012-12-03 18:47:41 +0100
commit4661934e31d3eee9414eb44ffc5a7e355326bc31 (patch)
treea9b4bbcb3a85a89d1a5f8311c4d7e3afcaa776d2 /sys/src/ape/lib/ap/plan9/_envsetup.c
parent52b9a0689603622fe9f2b7610e428c125e4acbb7 (diff)
ape: fix _grpmems(), access(), getppid(), cleanup
_grpmems() was broken tokenizing group list in place. we have to copy it to status buffer before tokenizing. dynamically alloc path for test file to check write permission on directory and add pid to the name to prevent races. use _OPEN instead of ape open to read /dev/ppid in getppid(). use mode enums instead of numeric constants for _OPEN() and _CREATE().
Diffstat (limited to 'sys/src/ape/lib/ap/plan9/_envsetup.c')
-rw-r--r--sys/src/ape/lib/ap/plan9/_envsetup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/src/ape/lib/ap/plan9/_envsetup.c b/sys/src/ape/lib/ap/plan9/_envsetup.c
index 11f53dc81..21d6be3f4 100644
--- a/sys/src/ape/lib/ap/plan9/_envsetup.c
+++ b/sys/src/ape/lib/ap/plan9/_envsetup.c
@@ -44,7 +44,7 @@ _envsetup(void)
nohandle = 0;
fdinited = 0;
cnt = 0;
- dfd = _OPEN("/env", 0);
+ dfd = _OPEN("/env", OREAD);
if(dfd < 0)
goto done;
psize = Envhunk;
@@ -63,7 +63,7 @@ _envsetup(void)
}
strcpy(p, "/env/");
memcpy(p+5, d9->name, n+1);
- f = _OPEN(p, 0);
+ f = _OPEN(p, OREAD);
memset(p, 0, n+6);
memcpy(p, d9->name, n);
p[n] = '=';