From d012e0579a2819ce68ab14fc986a8c999fb05e60 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 13 Mar 2017 18:07:59 +0100 Subject: [PATCH] check unlink() return value in test --- src/sq/test_sq.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/sq/test_sq.c b/src/sq/test_sq.c index e6896861e..42c321666 100644 --- a/src/sq/test_sq.c +++ b/src/sq/test_sq.c @@ -254,7 +254,10 @@ main(int argc, fprintf (stderr, "Failed to create table\n"); sqlite3_close (dbh); - unlink ("test.db"); + if (0 != unlink ("test.db")) + GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, + "unlink", + "test.db"); return 1; } @@ -266,12 +269,13 @@ main(int argc, { fprintf (stderr, "Failed to drop table\n"); - sqlite3_close (dbh); - unlink ("test.db"); - return 1; + ret = 1; } sqlite3_close (dbh); - unlink ("test.db"); + if (0 != unlink ("test.db")) + GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, + "unlink", + "test.db"); return ret; } -- 2.25.1