Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: mmap error
- X-seq: zsh-workers 9505
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: PATCH: mmap error
- Date: Tue, 1 Feb 2000 14:07:20 +0100 (MET)
- In-reply-to: Clint Adams's message of Mon, 31 Jan 2000 13:35:46 -0500
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Clint Adams wrote:
> 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.
Hm, I think I prefer this one, it's the same as what we do in zalloc().
Bye
Sven
diff -ru ../z.old/Src/mem.c Src/mem.c
--- ../z.old/Src/mem.c Tue Feb 1 12:00:20 2000
+++ Src/mem.c Tue Feb 1 14:06:53 2000
@@ -356,6 +356,10 @@
n = (n + pgsz) & ~pgsz;
h = (Heap) mmap(NULL, n, PROT_READ | PROT_WRITE,
MMAP_FLAGS, -1, 0);
+ if (h == ((Heap) -1)) {
+ zerr("fatal error: out of heap memory", NULL, 0);
+ exit(1);
+ }
h->size = n;
}
#else
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author