]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
Fix fulltest TIOCGPGRP failure when run from shell
authorTulio A M Mendes <[email protected]>
Fri, 17 Apr 2026 17:01:34 +0000 (14:01 -0300)
committerTulio A M Mendes <[email protected]>
Fri, 17 Apr 2026 17:01:34 +0000 (14:01 -0300)
commit82b0e298922a0d51cca2cd7c231b4ed9fd222171
treefa0e25629d750d70f7d5fee2a630d3b2ebd88688
parent2263b4617434f333b33d049ce0025ff09cc58a81
Fix fulltest TIOCGPGRP failure when run from shell

When fulltest runs from /bin/sh (rather than as init directly), the
shell has already claimed the controlling TTY via setsid(), setting
tty_fg_pgrp to a non-zero value. The test assumed fg == 0, which
only holds when running as PID 1 (session_id=0, pgrp_id=0).

Fix: compare TIOCGPGRP result against sys_getpgrp() instead of
hardcoded 0, use our own pgrp for TIOCSPGRP success test, and use
fg=-1 (EINVAL) instead of fg=1 for the expected-failure case.

Also rename 'hello from init.elf' to 'hello from fulltest.elf' in
both the test binary and the smoke test expectations.
tests/smoke_test.exp
user/cmds/fulltest/fulltest.c