Module Name:    src
Committed By:   joerg
Date:           Fri Feb 24 13:53:47 UTC 2012

Modified Files:
        src/tests/fs/nfs: Makefile t_mountd.c

Log Message:
Fix obvious code issues and remove the original -Wno-error for clang
builds to not hide them in the future:
(1) Don't use a pointer to a local variables if all that is done is
comparing it against NULL. The function itself works fine for that
purpose.

(2) Initialise the fail counter, giving the test a chance to work
reliably.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/fs/nfs/Makefile
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/nfs/t_mountd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/nfs/Makefile
diff -u src/tests/fs/nfs/Makefile:1.7 src/tests/fs/nfs/Makefile:1.8
--- src/tests/fs/nfs/Makefile:1.7	Mon Feb 13 22:40:43 2012
+++ src/tests/fs/nfs/Makefile	Fri Feb 24 13:53:46 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2012/02/13 22:40:43 bouyer Exp $
+#	$NetBSD: Makefile,v 1.8 2012/02/24 13:53:46 joerg Exp $
 #
 
 .include <bsd.own.mk>
@@ -26,6 +26,4 @@ LDADD+=-lrump -lrumpuser -lpthread      
 
 LDADD+=-lutil
 
-NOCLANGERROR=	# defined
-
 .include <bsd.test.mk>

Index: src/tests/fs/nfs/t_mountd.c
diff -u src/tests/fs/nfs/t_mountd.c:1.4 src/tests/fs/nfs/t_mountd.c:1.5
--- src/tests/fs/nfs/t_mountd.c:1.4	Sun Jun 26 13:08:08 2011
+++ src/tests/fs/nfs/t_mountd.c	Fri Feb 24 13:53:46 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_mountd.c,v 1.4 2011/06/26 13:08:08 christos Exp $	*/
+/*	$NetBSD: t_mountd.c,v 1.5 2012/02/24 13:53:46 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -59,6 +59,8 @@ wrkwrkwrk(void *unused)
 {
 	int fd, fail;
 
+	fail = 0;
+
 	rump_sys_chdir(FSTEST_MNTNAME);
 	while (!quit) {
 		fd = rump_sys_open("file", O_RDWR | O_CREAT);
@@ -79,7 +81,7 @@ wrkwrkwrk(void *unused)
 	rump_sys_chdir("/");
 	quit = 1;
 
-	return fail ? &fail : NULL;
+	return fail ? wrkwrkwrk : NULL;
 }
 
 ATF_TC_BODY(mountdhup, tc)

Reply via email to