Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: mmap error



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