Source-Changes-HG archive

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

[src/trunk]: src/tests/kernel/tty Simplify



details:   https://anonhg.NetBSD.org/src/rev/7869ee5941af
branches:  trunk
changeset: 764539:7869ee5941af
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Apr 26 18:50:53 2011 +0000

description:
Simplify

diffstat:

 tests/kernel/tty/t_pr.c |  19 ++++---------------
 1 files changed, 4 insertions(+), 15 deletions(-)

diffs (54 lines):

diff -r e88ccfec3f5e -r 7869ee5941af tests/kernel/tty/t_pr.c
--- a/tests/kernel/tty/t_pr.c   Tue Apr 26 18:42:08 2011 +0000
+++ b/tests/kernel/tty/t_pr.c   Tue Apr 26 18:50:53 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_pr.c,v 1.5 2011/04/09 11:55:59 martin Exp $  */
+/*     $NetBSD: t_pr.c,v 1.6 2011/04/26 18:50:53 martin Exp $  */
 
 #include <sys/types.h>
 #include <sys/ioctl.h>
@@ -13,17 +13,6 @@
 #include <rump/rump.h>
 #include <rump/rump_syscalls.h>
 
-static bool init_done = false;
-
-static void
-init(void)
-{
-       if (init_done)
-               return;
-       rump_init();
-       init_done = true;
-}
-
 static int
 sendsome(int from, int to)
 {
@@ -89,7 +78,7 @@
 {
        int master, slave, error, v;
 
-       init();
+       rump_init();
        slave =  rump_sys_open("/dev/ttyp1", O_RDWR|O_NONBLOCK);
        ATF_CHECK(slave != -1);
 
@@ -117,7 +106,7 @@
 {
        int master, slave, error;
 
-       init();
+       rump_init();
        master = rump_sys_open("/dev/ptyp1", O_RDWR);
        ATF_CHECK(master != -1);
 
@@ -144,7 +133,7 @@
        struct termios tio;
        int fd;
 
-       init();
+       rump_init();
        fd = rump_sys_open("/dev/ptyp1", O_RDWR);
        ATF_CHECK(fd != -1);
 



Home | Main Index | Thread Index | Old Index