Description: gcc requires 3rd argument to open when called wirh O_CREAT
Author: Michael Terry <michael.terry@canonical.com>
Integrated: Ralf Treinen <treinen@debian.org>
Debian-bug:  #531744

diff -urNad yap-5.1.3~/C/alloc.c yap-5.1.3/C/alloc.c
--- yap-5.1.3~/C/alloc.c	2008-08-20 19:23:12.000000000 +0200
+++ yap-5.1.3/C/alloc.c	2009-06-12 20:53:49.000000000 +0200
@@ -829,7 +829,7 @@
     itos(getpid(), &file[12]);
 #endif /* HAVE_TMPNAM */
 #endif /* HAVE_MKSTEMP */
-    fd = open(file, O_CREAT|O_RDWR);
+    fd = open(file, O_CREAT|O_RDWR, 0644);
     if (fd < 0) {
       Yap_Error(FATAL_ERROR, TermNil, "mmap could not open %s", file);
       return NULL;
@@ -942,7 +942,7 @@
     itos(getpid(), &file[12]);
 #endif /* HAVE_TMPNAM */
 #endif /* HAVE_MKSTEMP */
-    fd = open(file, O_CREAT|O_RDWR);
+    fd = open(file, O_CREAT|O_RDWR, 0644);
     if (fd < 0) {
       Yap_ErrorMessage = Yap_ErrorSay;
       snprintf4(Yap_ErrorMessage, MAX_ERROR_MSG_SIZE,
