From 174c1e7bf0ab969686a649c13a9dd335ee437165 Mon Sep 17 00:00:00 2001 From: Michael Shaw Date: Sun, 16 Feb 2025 11:01:21 -0500 Subject: [PATCH] shtest: remove garbage --- usr.bin/shtest/shtest.c | 77 ++--------------------------------------- 1 file changed, 2 insertions(+), 75 deletions(-) diff --git a/usr.bin/shtest/shtest.c b/usr.bin/shtest/shtest.c index a825010..a7630f2 100644 --- a/usr.bin/shtest/shtest.c +++ b/usr.bin/shtest/shtest.c @@ -28,13 +28,12 @@ void _start() if (term < 0) exit(1); - char buf[256]; int n; /* FIFOs!!!!!!!!! */ write(term, "mknod\n", 5); - int r = mknod("/dev/pts", S_IFIFO, 0); + mknod("/dev/pts", S_IFIFO, 0); write(term, "open\n", 5); int fifofd = open("/dev/pts", 0); @@ -58,79 +57,7 @@ void _start() while ((n = read(term, buf, 256)) > 0) { write(term, buf, n); - if(buf[0] == 'q') - break; - } - - exit(1234); -} -void end() -{ - int term = open("/dev/tty0", 0); - if (term < 0) - exit(1); - - - char buf[256]; - int n; - - /* FIFOs!!!!!!!!! */ - int r = mknod("/dev/pts", S_IFIFO, 0); - int fifofd = open("/dev/pts", 0); - if (fifofd < 0) - write(term, "open failed\n", 12); - - /* write hello to fifo */ - int i = write(fifofd, "hello\n", 6); - /* read back from fifo */ - i = read(fifofd, buf, 6); - - /* print output to terminal */ - write(term, "read back from fifo: ", 22); - write(term, buf, i); - promptfd(term); - - /* fork test */ - while ((n = read(term, buf, 256)) > 0) { - write(term, buf, n); - - if(buf[0] == 'q') - break; - } - - exit(1234); -} -void lol() -{ - int term = open("/dev/tty0", 0); - if (term < 0) - exit(1); - - - char buf[256]; - int n; - - /* FIFOs!!!!!!!!! */ - int r = mknod("/dev/pts", S_IFIFO, 0); - int fifofd = open("/dev/pts", 0); - if (fifofd < 0) - write(term, "open failed\n", 12); - - /* write hello to fifo */ - int i = write(fifofd, "hello\n", 6); - /* read back from fifo */ - i = read(fifofd, buf, 6); - - /* print output to terminal */ - write(term, "read back from fifo: ", 22); - write(term, buf, i); - promptfd(term); - - /* fork test */ - while ((n = read(term, buf, 256)) > 0) { - write(term, buf, n); - - if(buf[0] == 'q') + if (buf[0] == 'q') break; }