We prove that a positive unital linear mapping from a von Neumann algebra to a unital C*-algebra is a Jordan homomorphism if it maps invertible selfadjoint elements to invertible elements, and that for any compact Hausdorff space X, all positive unital linear mappings from C(X) into a unital C*-algebra that preserve the invertibility for self-adjoint elements are *-homomorphisms if and only if X is totally disconnected.