From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28092 invoked from network); 1 Feb 2000 13:07:28 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 1 Feb 2000 13:07:28 -0000 Received: (qmail 8081 invoked by alias); 1 Feb 2000 13:07:22 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9505 Received: (qmail 8072 invoked from network); 1 Feb 2000 13:07:22 -0000 Date: Tue, 1 Feb 2000 14:07:20 +0100 (MET) Message-Id: <200002011307.OAA08125@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Clint Adams's message of Mon, 31 Jan 2000 13:35:46 -0500 Subject: Re: PATCH: mmap error 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@informatik.hu-berlin.de