Hi Robin, Thanks for your patch! On 17-11-2006 13:36:39 +0100, Robin Aly wrote:
I recently compiled MonetDB on a NFS-home-directory (stupid, now that I think of it). The error message I got was: !FATAL: GDKlockHome: Database lock '.gdk_lock' denied
After some investigations I found out that in /cvsroot/monetdb/MonetDB/src/gdk/gdk_posix.mx the original OS-error message was discarded and a simple error-return-value was choosen. I suggest to change it to something like what is attached to this mail.
What was the actual problem in your case? lockd not running?
Index: gdk_posix.mx =================================================================== RCS file: /cvsroot/monetdb/MonetDB/src/gdk/gdk_posix.mx,v retrieving revision 1.119 diff -r1.119 gdk_posix.mx 1765c1765,1766 < if (fd < 0) ---
if (fd < 0) { perror("MonetDB (open): "); 1767,1768c1768,1782 < if (lseek(fd, off, SEEK_SET) == off) < ret = (lockf(fd, mode, len) == 0) ? 1 : -1;
}
With this change you actually change the behaviour of the function (and it's contract). These kind of diffs are extremely hard to read, so I might be wrong. In any case, perror is not the solution here, and as far as I know the current behaviour is used consistently within MonetDB at the moment. It probably is better to try and fix this better at the caller of this function using errno and strerror.
if (lseek(fd, off, SEEK_SET) == off) { ret = lockf(fd, mode, len); if (ret==0) { ret=1;
} else { perror("MonetDB (lockf): "); ret=-1; } } else { perror("MonetDB (lseek):"); }