lib/tdb2: tools should use config.h, and replace where available.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 21 Feb 2012 04:59:12 +0000 (15:29 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 21 Feb 2012 04:59:12 +0000 (15:29 +1030)
The tdb2 tools should #include "config.h" before tdb2.h (about to
become a requirement) and use libreplace where available.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
lib/tdb2/tools/tdb2backup.c
lib/tdb2/tools/tdb2dump.c
lib/tdb2/tools/tdb2restore.c
lib/tdb2/tools/tdb2tool.c
lib/tdb2/tools/tdb2torture.c

index 531bf29accbf2cbd5646012f4032b6f7a98b169a..729ae720b498ed7eb458bde48d6b6edf1b5814dd 100644 (file)
@@ -40,6 +40,7 @@
 
  */
 
+#include "config.h"
 #include "tdb2.h"
 #include "system/filesys.h"
 
index abe1d9b87100a362d74a72400b5360d0eaef1fe5..40230a26431a8cf4bfd92f2b5b966b7f5bc25dde 100644 (file)
    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 "tdb2.h"
+#ifdef HAVE_LIBREPLACE
+#include <replace.h>
+#include <system/filesys.h>
+#include <system/locale.h>
+#else
 #include <ctype.h>
 #include <stdio.h>
 #include <sys/types.h>
@@ -24,6 +30,7 @@
 #include <fcntl.h>
 #include <stdlib.h>
 #include <unistd.h>
+#endif
 
 static void print_data(TDB_DATA d)
 {
index 658215a16c4c96708ada14860916201fbfd547a4..608b46de18d27d0be852a9139ae08ac37fa975c8 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include "config.h"
 #include "tdb2.h"
 #include <assert.h>
+#ifdef HAVE_LIBREPLACE
+#include <replace.h>
+#include <system/filesys.h>
+#else
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
+#endif
 
 #define debug_fprintf(file, fmt, ...) do {/*nothing*/} while (0)
 
index 9b3554de6c3a9745058d081513a47240db2cd79f..ae20971143ff07cc0f30d6b23e56533ae14d0b67 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include "config.h"
 #include "tdb2.h"
+#ifdef HAVE_LIBREPLACE
+#include <replace.h>
+#include <system/filesys.h>
+#include <system/time.h>
+#include <system/locale.h>
+#else
 #include <stdlib.h>
 #include <stdio.h>
 #include <ctype.h>
@@ -31,6 +38,7 @@
 #include <errno.h>
 #include <string.h>
 #include <stdarg.h>
+#endif
 
 static int do_command(void);
 const char *cmdname;
index 83847da027f2c5b95b5c715a0709bf2aac929382..1c1efc593ae2bbc65bbc5ae79627e2e8509c3cdb 100644 (file)
@@ -2,9 +2,13 @@
    writers - that stresses the locking code.
 */
 
+#include "config.h"
 #include "tdb2.h"
-#include <stdlib.h>
 #include <err.h>
+#ifdef HAVE_LIBREPLACE
+#include <replace.h>
+#else
+#include <stdlib.h>
 #include <getopt.h>
 #include <stdarg.h>
 #include <stdio.h>
@@ -15,6 +19,7 @@
 #include <fcntl.h>
 #include <time.h>
 #include <sys/wait.h>
+#endif
 
 /* Currently we default to creating a tdb1.  This will change! */
 #define TDB2_IS_DEFAULT false