#8 irattach logs bad error message on TIOCSETD failure

open
nobody
None
5
2014-08-13
2006-09-03
Michael Shigorin
No

irattach daemonizes (closing fds) before calling
fprintf(stderr, ...); this results in EBADF instead of
proper diagnostics if TIOCSETD ioctl fails.

Either fds should be redirected to /dev/null, or at
least syslog()/fprintf() order should be reversed.

Patch to do the first fixup is attached (by Sergey
Vlasov, vsu altlinux org); see also

https://bugzilla.altlinux.org/show_bug.cgi?id=6257 [ru]
https://bugzilla.altlinux.org/attachment.cgi?id=1615&action=edit

BTW, ALT Linux package has a few more patches, e.g.
http://sisyphus.ru/srpm/irda-utils/patches/3 (page in
Russian, patch in C ;-).

Discussion