Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: mmap error
- X-seq: zsh-workers 9500
- From: Clint Adams <schizo@xxxxxxxxxx>
- To: ZSH-workers@xxxxxxxxxxxxxx
- Subject: PATCH: mmap error
- Date: Mon, 31 Jan 2000 13:35:46 -0500
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
This is not an elegant solution. Of course, I'm not even sure that it works.
The point is to not segfault after mmap failure.
Index: Src/mem.c
===================================================================
RCS file: /cvs/zsh/zsh/Src/mem.c,v
retrieving revision 1.1.1.14
diff -u -r1.1.1.14 mem.c
--- Src/mem.c 2000/01/20 09:01:44 1.1.1.14
+++ Src/mem.c 2000/01/31 18:21:46
@@ -356,6 +356,7 @@
n = (n + pgsz) & ~pgsz;
h = (Heap) mmap(NULL, n, PROT_READ | PROT_WRITE,
MMAP_FLAGS, -1, 0);
+ if(h==-1) { perror("mmap error"); exit;}
h->size = n;
}
#else
Messages sorted by:
Reverse Date,
Date,
Thread,
Author