SAN FRANCISCO -- Buster Posey hit a three-run homer in the sixth, Tim Hudson pitched six scoreless innings and the San Francisco Giants ended a six-game home losing streak to Arizona, beating the Diamondbacks 5-1 on Sunday.