it's an error only if the filedescriptor is invalid