Gah...the problem was printf's different buffering tolerances depending on where the fd points.  Code wasn't broken, just logic :)