summaryrefslogtreecommitdiff
path: root/sys/src/libc/port/malloc.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2020-12-07 14:24:51 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2020-12-07 14:24:51 +0100
commitf1e15da8f550b12196d57e245437251f6eb289b5 (patch)
tree056e930a518b6e4a5e993fcad133ba4bc9855a01 /sys/src/libc/port/malloc.c
parent544bca0290df1dc512641a1ab23e184ccc2406b3 (diff)
libc: open internal file-descriptor with OCEXEC flag
Diffstat (limited to 'sys/src/libc/port/malloc.c')
-rw-r--r--sys/src/libc/port/malloc.c8
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;