Comment 2 for bug 1604737

<infinity> xnox: Is stvtrgb using GIO_CMAP/PIO_CMAP?
<xnox> infinity,
<xnox> iterates conspaths, and open_a_console must succeed, wtih is_a_consoole
<xnox> return (isatty (fd)
<xnox> && ioctl(fd, KDGKBTYPE, &arg) == 0
<xnox> && ((arg == KB_101) || (arg == KB_84)));
<xnox> no idea what GIO_CMAP and PIO_CMAP are
<infinity> xnox: I meant to do the color setting.
<infinity> xnox: But yes, that confirms my suspicion that they probably are, as they're testing explicitly if a Linux VC IOCTL works.
<infinity> xnox: So, the only error, IMO, is that they exit non-zero if none of the scanned victims are Linux VCs.
<infinity> xnox: Which would fail on any completely headless system.
<infinity> ie: I could reproduce this on PPC just as easily.
<infinity> I would suggest that if all is_a_console() attempts fail, you'd want to exit 0, and then later, if setting colours on something we thought should work fails, exit non-zero.
<xnox> right
<infinity> Ahh, and getfd exits 1 when is_a_console asplodes, so setvtrgb:main() just needs to test for that and either exit 0 or attempt to apply colors.
<infinity> Just missing that one branch there, IMO. It never tests the return of getfd(), it just assumes it got a useful result.