This fixes #7665.  It now returns -1 if the save didn't work.