X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=common-src%2Famflock-test.c;h=834562179bca198e54c7dad39a4ceaebc427345b;hb=HEAD;hp=cffde0aa6e5c64a99115e6668dae21e537e2a1f4;hpb=d5853102f67d85d8e169f9dbe973ad573306c215;p=debian%2Famanda diff --git a/common-src/amflock-test.c b/common-src/amflock-test.c index cffde0a..8345621 100644 --- a/common-src/amflock-test.c +++ b/common-src/amflock-test.c @@ -1,6 +1,7 @@ /* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park + * Copyright (c) 2007-2012 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its @@ -36,7 +37,7 @@ extern amflock_impl_t *amflock_impls[]; /* Test all amflock implementations available for basic * functionality */ -static int +static gboolean test_old_impls(void) { amflock_impl_t **imp = amflock_impls; @@ -54,29 +55,29 @@ test_old_impls(void) 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 */ @@ -88,7 +89,7 @@ test_old_impls(void) imp++; } - return 1; + return TRUE; } /* @@ -290,7 +291,7 @@ test_intra_proc_locking_thd(gpointer *fdptr) return NULL; } -static int +static gboolean test_intra_proc_locking(void) { GThread *thd; @@ -320,7 +321,7 @@ test_intra_proc_locking(void) return rv; } -static int +static gboolean test_inter_proc_locking(void) { int outpipe[2], inpipe[2];