Download raw body.
got-build-regress.sh regress failure
On 2023/04/21 10:03:25 +0200, Omar Polo <op@omarpolo.com> wrote: > 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.) Upon a second look I think it's probably better to just dup the fd for /dev/null and use it for tog.cin too. Maybe it was intended since cout is open with w+. Regress still passes from me (I'm using `nq make -C regress/tog' to replicate the case without a tty, which is equivalent to running the regress under cron.) diff /home/op/w/gotacl commit - 9cbac887301ab85a09a6e123f9963b76f60514e1 path + /home/op/w/gotacl blob - a411c9ed187b845c6ae5b24e656b8f43e9515a72 file + tog/tog.c --- tog/tog.c +++ tog/tog.c @@ -4186,6 +4186,7 @@ init_mock_term(const char *test_script_path) init_mock_term(const char *test_script_path) { const struct got_error *err = NULL; + int in; if (test_script_path == NULL || *test_script_path == '\0') return got_error_msg(GOT_ERR_IO, "TOG_TEST_SCRIPT not defined"); @@ -4200,13 +4201,19 @@ init_mock_term(const char *test_script_path) /* test mode, we don't want any output */ tog_io.cout = fopen("/dev/null", "w+"); if (tog_io.cout == NULL) { - err = got_error_from_errno("fopen: /dev/null"); + err = got_error_from_errno2("fopen", "/dev/null"); goto done; } - tog_io.cin = fopen("/dev/tty", "r+"); + in = dup(fileno(tog_io.cout)); + if (in == -1) { + err = got_error_from_errno("dup"); + goto done; + } + tog_io.cin = fdopen(in, "r"); if (tog_io.cin == NULL) { - err = got_error_from_errno("fopen: /dev/tty"); + err = got_error_from_errno("fdopen"); + close(in); goto done; }
got-build-regress.sh regress failure