diff options
author | Alex Musolino <alex@musolino.id.au> | 2020-12-15 20:55:41 +1030 |
---|---|---|
committer | Alex Musolino <alex@musolino.id.au> | 2020-12-15 20:55:41 +1030 |
commit | 3749e92cdb88a157f99c0709a264bd508603be9b (patch) | |
tree | 49ce703965ba4114490729c5aeabd9ba120d9b78 /sys/src/libc/port/malloc.c | |
parent | 404c901f299c4d93cb159a3c44c2977a25408319 (diff) | |
parent | 32291b52bcbd6976051acff1692b571e321ac859 (diff) |
merge
Diffstat (limited to 'sys/src/libc/port/malloc.c')
-rw-r--r-- | sys/src/libc/port/malloc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/src/libc/port/malloc.c b/sys/src/libc/port/malloc.c index 907bfa8a6..d738cc4b9 100644 --- a/sys/src/libc/port/malloc.c +++ b/sys/src/libc/port/malloc.c @@ -99,13 +99,13 @@ checkenv(void) { int n, fd; char buf[20]; - fd = open("/env/MALLOCFD", OREAD); + fd = open("/env/MALLOCFD", OREAD|OCEXEC); if(fd < 0) return -1; - if((n = read(fd, buf, sizeof buf)) < 0) { - close(fd); + n = read(fd, buf, sizeof buf); + close(fd); + if(n < 0) return -1; - } if(n >= sizeof buf) n = sizeof(buf)-1; buf[n] = 0; |