From 6cf8b299a4658a235033f77c2645b76043ff801e Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 8 Nov 2020 20:57:35 -0800 Subject: Clean up some warnings. --- tests/testutil.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/testutil.c b/tests/testutil.c index 7068e394..ce9978ce 100644 --- a/tests/testutil.c +++ b/tests/testutil.c @@ -267,7 +267,10 @@ testutil_next_port(void) (void) UnlockFileEx(h, 0, MAXDWORD, MAXDWORD, &olp); #else fseek(f, 0, SEEK_SET); - (void) ftruncate(fileno(f), 0); + if (ftruncate(fileno(f), 0) != 0) { + (void) fclose(f); + return (0); + } (void) fprintf(f, "%u", port); (void) lockf(fileno(f), 0, F_ULOCK); -- cgit v1.2.3-70-g09d2