F_DUPFD fix (incorrect return value)