You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#include <config.h>
+
+#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/file.h>
#define ASSERT(expr) \
- do \
- { \
- if (!(expr)) \
- { \
- fprintf (stderr, "%s:%d: assertion failed, errno = %d\n", \
- __FILE__, __LINE__, errno); \
- fflush (stderr); \
- abort (); \
- } \
- } \
+ do \
+ { \
+ if (!(expr)) \
+ { \
+ fprintf (stderr, "%s:%d: assertion failed, errno = %d\n", \
+ __FILE__, __LINE__, errno); \
+ fflush (stderr); \
+ abort (); \
+ } \
+ } \
while (0)
static void
ASSERT (fd2 >= 0);
r = flock (fd2, LOCK_SH | LOCK_NB);
- ASSERT (r == 0); /* Was able to acquire a second shared lock. */
+ ASSERT (r == 0); /* Was able to acquire a second shared lock. */
ASSERT (flock (fd, LOCK_UN) == 0);
ASSERT (close (fd2) == 0);
ASSERT (fd2 >= 0);
r = flock (fd2, LOCK_SH | LOCK_NB);
- ASSERT (r == -1); /* Was unable to acquire a second exclusive lock. */
+ ASSERT (r == -1); /* Was unable to acquire a second exclusive lock. */
ASSERT (flock (fd, LOCK_UN) == 0);
ASSERT (close (fd2) == 0);