Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/fs/nfs Fix obvious code issues and remove the original...



details:   https://anonhg.NetBSD.org/src/rev/b21a1dc5df68
branches:  trunk
changeset: 777591:b21a1dc5df68
user:      joerg <joerg%NetBSD.org@localhost>
date:      Fri Feb 24 13:53:46 2012 +0000

description:
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.

diffstat:

 tests/fs/nfs/Makefile   |  4 +---
 tests/fs/nfs/t_mountd.c |  6 ++++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diffs (43 lines):

diff -r b0ffe6889728 -r b21a1dc5df68 tests/fs/nfs/Makefile
--- a/tests/fs/nfs/Makefile     Fri Feb 24 11:43:06 2012 +0000
+++ b/tests/fs/nfs/Makefile     Fri Feb 24 13:53:46 2012 +0000
@@ -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+=-lutil
 
-NOCLANGERROR=  # defined
-
 .include <bsd.test.mk>
diff -r b0ffe6889728 -r b21a1dc5df68 tests/fs/nfs/t_mountd.c
--- a/tests/fs/nfs/t_mountd.c   Fri Feb 24 11:43:06 2012 +0000
+++ b/tests/fs/nfs/t_mountd.c   Fri Feb 24 13:53:46 2012 +0000
@@ -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 @@
 {
        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 @@
        rump_sys_chdir("/");
        quit = 1;
 
-       return fail ? &fail : NULL;
+       return fail ? wrkwrkwrk : NULL;
 }
 
 ATF_TC_BODY(mountdhup, tc)



Home | Main Index | Thread Index | Old Index