/* Test all amflock implementations available for basic
* functionality
*/
-static int
+static gboolean
test_old_impls(void)
{
amflock_impl_t **imp = amflock_impls;
for (lock_ro = 0; lock_ro < 2; lock_ro++) { /* false (0) or true (1) */
if (unlink(TEST_FILENAME) == -1 && errno != ENOENT) {
perror("unlink");
- return 0;
+ return FALSE;
}
if ((fd = open(TEST_FILENAME, O_RDWR | O_CREAT | O_EXCL, 0600)) == -1) {
perror("open");
- return 0;
+ return FALSE;
}
if (lock_ro) {
if ((*imp)->amroflock_impl(fd, resource) != 0) {
perror("amroflock");
- return 0;
+ return FALSE;
}
} else {
if ((*imp)->amflock_impl(fd, resource) != 0) {
perror("amflock");
- return 0;
+ return FALSE;
}
}
if ((*imp)->amfunlock_impl(fd, resource) != 0) {
perror("amfunlock");
- return 0;
+ return FALSE;
}
close(fd); /* ignore error */
imp++;
}
- return 1;
+ return TRUE;
}
/*
return NULL;
}
-static int
+static gboolean
test_intra_proc_locking(void)
{
GThread *thd;
return rv;
}
-static int
+static gboolean
test_inter_proc_locking(void)
{
int outpipe[2], inpipe[2];