Update of /cvsroot/fink/fink
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24010
Modified Files:
ChangeLog lockwait.in
Log Message:
graceful failure for locking
Index: lockwait.in
===================================================================
RCS file: /cvsroot/fink/fink/lockwait.in,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- lockwait.in 18 Oct 2005 23:09:15 -0000 1.5
+++ lockwait.in 19 Mar 2006 08:50:47 -0000 1.6
@@ -30,7 +30,8 @@
# short l_whence; /* type of l_start */
# };
my $struct_flock = pack("lllliss", (0, 0), (0, 0), 0, F_WRLCK,
SEEK_SET);
- unless (fcntl(LOCK, F_SETLK, $struct_flock)) {
+ my $lock_ok = fcntl(LOCK, F_SETLK, $struct_flock);
+ unless ($lock_ok || $! == EOPNOTSUPP || $! == ENOLCK) {
die "lockwait: Can't get lock: $!" unless $! == EAGAIN || $! ==
EACCES;
my $msg = $timeout ? "up to $timeout seconds " : "";
@@ -50,7 +51,10 @@
}
print STDERR "done.\n";
}
- print STDERR "Got the lock\n" if $debug;
+ print STDERR "Got the lock\n" if $debug && $lock_ok;
+ print STDERR "WARNING: No locking is available on this filesystem.\n" .
+ "To ensure safety, do not run multiple instances
simultaneously.\n"
+ if !$lock_ok;
print STDERR "Clear close-on-exec, so exec'ed process gets the lock\n"
if $debug;
Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/ChangeLog,v
retrieving revision 1.404
retrieving revision 1.405
diff -u -d -r1.404 -r1.405
--- ChangeLog 18 Mar 2006 23:56:03 -0000 1.404
+++ ChangeLog 19 Mar 2006 08:50:47 -0000 1.405
@@ -1,3 +1,7 @@
+2006-03-19 Dave Vasilevsky <[EMAIL PROTECTED]>
+
+ * lockwait.in: Fail gracefully if locking is not supported.
+
2006-03-18 Dave Vasilevsky <[EMAIL PROTECTED]>
* fink-scanpackages.in: Indicate the prefix explicitly, so we don't have
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Fink-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-commits