fix undefined reference to file descriptor