Created attachment 149537 [details]
Always print allocated pty to stdout
When rfcomm_sppd is told to daemonize (-b), it does not write the name of the pty it obtained through openpty() to standard output. This probably wasn't a problem before openpty() was used, as one had to manually specify which pty should be used.
The attached patch causes rfcomm_sppd to unconditionally output the path to the allocated pty, before daemonizing. Without it, there is no (robust) way to determine which pty was allocated, after the fact.
Created attachment 149538 [details]
Always print+flush allocated pty to stdout
A fflush(stdout) was missing in the original patch, to flush the stdio buffer before daemonizing. This patch adds that.