Thu Mar 10 01:51:39 ART 2005  Alberto Bertogli (albertogli@telpin.com.ar)
  * Allow pthread_mutex_lock()/unlock() to fail in the preloader.
diff -rN -u old-libjio/bindings/preload/libjio_preload.c new-libjio/bindings/preload/libjio_preload.c
--- old-libjio/bindings/preload/libjio_preload.c	2005-03-10 15:15:11.127755231 -0300
+++ new-libjio/bindings/preload/libjio_preload.c	2005-03-10 15:15:11.146753189 -0300
@@ -108,26 +108,30 @@
  * catch out of bounds accesses */
 static inline int fd_lock(int fd)
 {
+	int r;
+
 	if (fd < 0 || fd >= MAXFD) {
 		printd("locking out of bounds fd %d\n", fd);
 		return 0;
 	}
 	//printd("L %d\n", fd);
-	pthread_mutex_lock(&(fd_table[fd].lock));
+	r = pthread_mutex_lock(&(fd_table[fd].lock));
 	//printd("OK %d\n", fd);
-	return 1;
+	return !r;
 }
 
 static inline int fd_unlock(int fd)
 {
+	int r;
+
 	if (fd < 0 || fd >= MAXFD) {
 		printd("unlocking out of bounds fd %d\n", fd);
 		return 0;
 	}
 	//printd("U %d\n", fd);
-	pthread_mutex_unlock(&(fd_table[fd].lock));
+	r = pthread_mutex_unlock(&(fd_table[fd].lock));
 	//printd("OK %d\n", fd);
-	return 1;
+	return !r;
 }
 
 


