"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
Re: got-build-regress.sh regress failure
To:
stsp@stsp.name
Cc:
gameoftrees@openbsd.org
Date:
Fri, 21 Apr 2023 10:03:25 +0200

Download raw body.

Thread
On 2023/04/21 08:10:18 +0200, stsp@stsp.name wrote:
> ===> regress/tog
> ==== log ====
> ./log.sh -q -r "/tmp"
> tog: fopen: /dev/tty: Device not configured
> diff: /tmp/tog-test-log_hsplit_diff-oHQDaq7m/view: No such file or directory
> test failed; leaving test data in /tmp/tog-test-log_hsplit_diff-oHQDaq7m
> tog: fopen: /dev/tty: Device not configured
> [...]

i've hit the same in my i386 regress.  init_mock_term() tries to open
/dev/tty, but that device may not be available in all circumstances.

This seems to fix it for me, but I haven't looked closer at how the
tog regress suite works (yet!) and don't know if this breaks some
assumption not catched by regress.

(tog_io_close() will close stdin now, but I guess it's not a problem.)

diff /home/op/w/got
commit - 9cbac887301ab85a09a6e123f9963b76f60514e1
path + /home/op/w/got
blob - a411c9ed187b845c6ae5b24e656b8f43e9515a72
file + tog/tog.c
--- tog/tog.c
+++ tog/tog.c
@@ -4204,11 +4204,8 @@ init_mock_term(const char *test_script_path)
 		goto done;
 	}
 
-	tog_io.cin = fopen("/dev/tty", "r+");
-	if (tog_io.cin == NULL) {
-		err = got_error_from_errno("fopen: /dev/tty");
-		goto done;
-	}
+	/* /dev/tty may not be available during regress. */
+	tog_io.cin = stdin;
 
 	if (fseeko(tog_io.f, 0L, SEEK_SET) == -1) {
 		err = got_error_from_errno("fseeko");