fcntl bug fix for returning values