Fix rsync exit handling in create mode.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 13 Jun 2016 15:54:37 +0000 (17:54 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 24 Jun 2016 14:17:16 +0000 (16:17 +0200)
commit0f2b297697d2c5d0ab9ee71d51c2e47fb4508aba
tree4304302f800c9026e28c36aa6f404128d2762034
parent59a00ae47578272f3ca9cf882ebeb5dfe16ba6c6
Fix rsync exit handling in create mode.

The logic in handle_rsync_exit() is horribly broken in case dss is
run in create mode and the rsync process terminates unsuccessfully.

First we claim to restart rsync, which is wrong. Next we call the
post-create hook despite the documentation says that this hook is
only run on *successful* termination. Finally, we dereference a NULL
pointer to print the path of the snapshot.

Fortunately, all three issues are easy to fix by special casing create
mode in handle_rsync_exit().
dss.c