[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fix test-flock.c
From: |
Bruno Haible |
Subject: |
fix test-flock.c |
Date: |
Sat, 15 Nov 2008 13:33:33 +0100 |
User-agent: |
KMail/1.5.4 |
Hi,
On Haiku this test fails to compile:
/data/testdir3/gltests/test-flock.c: In function `test_shared':
/data/testdir3/gltests/test-flock.c:47: warning: implicit declaration of
function `open'
/data/testdir3/gltests/test-flock.c:47: `O_RDWR' undeclared (first use in this
function)
/data/testdir3/gltests/test-flock.c:47: (Each undeclared identifier is reported
only once
/data/testdir3/gltests/test-flock.c:47: for each function it appears in.)
/data/testdir3/gltests/test-flock.c: In function `test_exclusive':
/data/testdir3/gltests/test-flock.c:65: `O_RDWR' undeclared (first use in this
function)
/data/testdir3/gltests/test-flock.c: In function `main':
/data/testdir3/gltests/test-flock.c:82: `O_RDWR' undeclared (first use in this
function)
/data/testdir3/gltests/test-flock.c:82: `O_CREAT' undeclared (first use in this
function)
/data/testdir3/gltests/test-flock.c:82: `O_TRUNC' undeclared (first use in this
function)
make[4]: *** [test-flock.o] Error 1
Very clear: It uses O_RDWR but does not include <fcntl.h>. Also it lacks
an include of <config.h>, needed for all code that uses gnulib. Fixing it
like this:
2008-11-15 Bruno Haible <address@hidden>
* tests/test-flock.c: Include config.h and <fcntl.h>.
* tests/test-iconvme.c: Include config.h.
* tests/test-stpncpy.c: Likewise.
--- tests/test-flock.c.orig 2008-11-15 13:29:34.000000000 +0100
+++ tests/test-flock.c 2008-11-15 13:29:18.000000000 +0100
@@ -14,6 +14,9 @@
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>
--- tests/test-iconvme.c.orig 2008-11-15 13:29:34.000000000 +0100
+++ tests/test-iconvme.c 2008-11-15 13:28:51.000000000 +0100
@@ -15,6 +15,8 @@
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 <stdlib.h>
#include <stdio.h>
--- tests/test-stpncpy.c.orig 2008-11-15 13:29:34.000000000 +0100
+++ tests/test-stpncpy.c 2008-11-15 13:29:03.000000000 +0100
@@ -1,5 +1,5 @@
/* Test the system defined function stpncpy().
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2008 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,6 +14,8 @@
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 <string.h>
#include <stdio.h>
- fix test-flock.c,
Bruno Haible <=