fname  is used in #else branch and common code bellow.