Now have return value from checkpoint denoting whether you have returned from a checkpoint or a restore. If a restore has just been completed, checkpoint_checkpoint() will return 1. If not, it returns 0.