tdb: don't use err.h in tests.
authorRusty Russell <rusty@rustcorp.com.au>
Fri, 22 Jun 2012 05:37:44 +0000 (15:07 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Fri, 22 Jun 2012 07:22:28 +0000 (09:22 +0200)
It's not portable.  While we could use ccan/err, it seems overkill since
we actually only use it in one test (I obviously cut & paste the #include).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date(master): Fri Jun 22 09:22:28 CEST 2012 on sn-devel-104

21 files changed:
lib/tdb/test/external-agent.c
lib/tdb/test/run-3G-file.c
lib/tdb/test/run-bad-tdb-header.c
lib/tdb/test/run-check.c
lib/tdb/test/run-corrupt.c
lib/tdb/test/run-die-during-transaction.c
lib/tdb/test/run-endian.c
lib/tdb/test/run-incompatible.c
lib/tdb/test/run-nested-transactions.c
lib/tdb/test/run-nested-traverse.c
lib/tdb/test/run-no-lock-during-traverse.c
lib/tdb/test/run-oldhash.c
lib/tdb/test/run-open-during-transaction.c
lib/tdb/test/run-readonly-check.c
lib/tdb/test/run-rwlock-check.c
lib/tdb/test/run-summary.c
lib/tdb/test/run-transaction-expand.c
lib/tdb/test/run-traverse-in-transaction.c
lib/tdb/test/run-wronghash-fail.c
lib/tdb/test/run-zero-append.c
lib/tdb/test/run.c

index d3fe8913fa5815f9362788d03c36758f28292c9d..139de76f9ad0dc3e474a25828ef872870cd200a6 100644 (file)
@@ -4,7 +4,6 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <unistd.h>
-#include <err.h>
 #include <fcntl.h>
 #include <stdlib.h>
 #include <limits.h>
@@ -138,7 +137,7 @@ struct agent *prepare_external_agent(void)
                result = do_operation(name[0], name+1);
                if (write(response[1], &result, sizeof(result))
                    != sizeof(result))
-                       err(1, "Writing response");
+                       abort();
        }
        exit(0);
 }
index 3b4e45739a115c7cac484fbe1b24ee184b700018..3ee9de15ed74b690b1504e98e283e464b7507ca6 100644 (file)
@@ -11,7 +11,6 @@
 #include "../common/hash.c"
 #include "tap-interface.h"
 #include <stdlib.h>
-#include <err.h>
 #include "logging.h"
 
 static int tdb_expand_file_sparse(struct tdb_context *tdb,
index 9dbb6225c91c61e94f509d48d85c504770025812..b00fb8934a4575a9d5e8c57f7e543dd811443340 100644 (file)
@@ -11,7 +11,6 @@
 #include "../common/hash.c"
 #include "tap-interface.h"
 #include <stdlib.h>
-#include <err.h>
 #include "logging.h"
 
 int main(int argc, char *argv[])
index 455731db944138b457c0ee1bc32d61110483d293..05f7aecd0839b3c842c907a9d33afbbfa809ef7d 100644 (file)
@@ -11,7 +11,6 @@
 #include "../common/hash.c"
 #include "tap-interface.h"
 #include <stdlib.h>
-#include <err.h>
 #include "logging.h"
 
 int main(int argc, char *argv[])
index 5d86e71498bec9749332f2467a3f15c0105e38ff..584f789bf8078ae7387849aa0aa8479cd94613e3 100644 (file)
@@ -11,7 +11,6 @@
 #include "../common/hash.c"
 #include "tap-interface.h"
 #include <stdlib.h>
-#include <err.h>
 #include "logging.h"
 
 static int check(TDB_DATA key, TDB_DATA data, void *private)
index ae7dafcfac7ede210ca0d6014da7e580326fe22a..19c9dbebf93c7ef45184d6708654dc50249eb0db 100644 (file)
@@ -23,7 +23,6 @@ static int ftruncate_check(int fd, off_t length);
 #include <stdlib.h>
 #include <stdbool.h>
 #include <stdarg.h>
-#include <err.h>
 #include <setjmp.h>
 #include "external-agent.h"
 #include "logging.h"
index bf6e71389f8af27b8243cd495d0bd71d32e7c761..b19ffd373f1fa7f23b3df78c0cb6bb8d65472ac2 100644 (file)
@@ -11,7 +11,6 @@
 #include "../common/hash.c"
 #include "tap-interface.h"
 #include <stdlib.h>
-#include <err.h>
 #include "logging.h"
 
 int main(int argc, char *argv[])
index 6097026b49a452521ab4b7a49d3ae4f3b01ad69d..628927c88687d0b21f4ac6782501bd71e461b034 100644 (file)
@@ -11,7 +11,6 @@
 #include "../common/hash.c"
 #include "tap-interface.h"
 #include <stdlib.h>
-#include <err.h>
 
 static unsigned int tdb_dumb_hash(TDB_DATA *key)
 {
index 45bc56338daab779121cd7c388da630d0d5764ed..8c84bcac836a4b2251f472e93241a9d5ec8f4448 100644 (file)
@@ -12,7 +12,6 @@
 #include "tap-interface.h"
 #include <stdlib.h>
 #include <stdbool.h>
-#include <err.h>
 #include "logging.h"
 
 int main(int argc, char *argv[])
index 83efd0d8ca872ecc39193dd1db51c72635907989..86f2913455703d5adbd7d15817247ab1aff5f22c 100644 (file)
@@ -15,7 +15,6 @@
 #undef fcntl
 #include <stdlib.h>
 #include <stdbool.h>
-#include <err.h>
 #include "external-agent.h"
 #include "logging.h"
 
index 25d9d784bf58fd12b26f6f8e2a230496e979439e..0a72282eb6d8274c2cfe7c2c3945109a1cb6f2b0 100644 (file)
@@ -15,7 +15,6 @@
 #include "../common/hash.c"
 #include "tap-interface.h"
 #include <stdlib.h>
-#include <err.h>
 #include "logging.h"
 
 #undef fcntl
index 22c6d13c179c4b01576152956fd8bb24a5b0a422..535336cb473c1a891e081bd23553f1f466a800c7 100644 (file)
@@ -11,7 +11,6 @@
 #include "../common/hash.c"
 #include "tap-interface.h"
 #include <stdlib.h>
-#include <err.h>
 #include "logging.h"
 
 int main(int argc, char *argv[])
index f4a00525d8d9d65237e60523f3f9c7446648198f..d46b216ccdc57515d89071ee39a40a47e490cf29 100644 (file)
@@ -24,7 +24,6 @@ static int ftruncate_check(int fd, off_t length);
 #include <stdlib.h>
 #include <stdbool.h>
 #include <stdarg.h>
-#include <err.h>
 #include "external-agent.h"
 #include "logging.h"
 
index b4b85fb7c71ea0fc5462b676f3aaaef089e3b73e..fdd9507cdad225503e2506e26577542feb2357cc 100644 (file)
@@ -13,7 +13,6 @@
 #include "../common/hash.c"
 #include "tap-interface.h"
 #include <stdlib.h>
-#include <err.h>
 #include "logging.h"
 
 int main(int argc, char *argv[])
index d7a86cd2c980e12df02722e73e38f7b2ca96b7af..8b8072db1e672c57d3748c641eded32d8b54285f 100644 (file)
@@ -11,7 +11,6 @@
 #include "../common/hash.c"
 #include "tap-interface.h"
 #include <stdlib.h>
-#include <err.h>
 
 static void log_fn(struct tdb_context *tdb, enum tdb_debug_level level, const char *fmt, ...)
 {
index 089338ce9c63965905b5267aa50503a2ea089d31..22312843e79ec9dab4580271f86e023ebb53155b 100644 (file)
@@ -12,7 +12,6 @@
 #include "../common/summary.c"
 #include "tap-interface.h"
 #include <stdlib.h>
-#include <err.h>
 
 int main(int argc, char *argv[])
 {
index bc22d2b53e47e02cdb2579775f99e94864e0640e..7f7b3fc1295737dcaf49c203872765b1cc8dc18c 100644 (file)
@@ -39,7 +39,6 @@ static inline int fake_fdatasync(int fd)
 #include "../common/hash.c"
 #include "tap-interface.h"
 #include <stdlib.h>
-#include <err.h>
 #include "logging.h"
 
 static void write_record(struct tdb_context *tdb, size_t extra_len,
index d8455176a2457f28e02dced14a83da8b2e4b962c..7813a6ce9a544f4bec960e0b112fdea109c592b6 100644 (file)
@@ -15,7 +15,6 @@
 #undef fcntl_with_lockcheck
 #include <stdlib.h>
 #include <stdbool.h>
-#include <err.h>
 #include "external-agent.h"
 #include "logging.h"
 
index e37aafdd9ee848e8625ee53c27f6f134360b92c6..74bbc30ba6fbf2b4ba6c791166d10b25d2df73f1 100644 (file)
@@ -11,7 +11,6 @@
 #include "../common/hash.c"
 #include "tap-interface.h"
 #include <stdlib.h>
-#include <err.h>
 
 static void log_fn(struct tdb_context *tdb, enum tdb_debug_level level, const char *fmt, ...)
 {
index 0ef30737ba6caa0e0c7776316193d78fe63de5dd..36bf6990f53eb32ac3bd0a478e0c971f9a0704a0 100644 (file)
@@ -11,7 +11,6 @@
 #include "../common/hash.c"
 #include "tap-interface.h"
 #include <stdlib.h>
-#include <err.h>
 #include "logging.h"
 
 int main(int argc, char *argv[])
index 89e55b7f65450f83eb149f0858925f9a149a7c14..f49e85055e561a788bbc7e030f2ffa3a2349419d 100644 (file)
@@ -11,7 +11,6 @@
 #include "../common/hash.c"
 #include "tap-interface.h"
 #include <stdlib.h>
-#include <err.h>
 #include "logging.h"
 
 int main(int argc, char *argv[])