]> git.tuebingen.mpg.de Git - dss.git/commit - dss.c
Use only one global variable for snapshot creation pids.
authorAndre Noll <maan@systemlinux.org>
Mon, 16 Mar 2009 15:57:56 +0000 (16:57 +0100)
committerAndre Noll <maan@systemlinux.org>
Mon, 16 Mar 2009 15:57:56 +0000 (16:57 +0100)
commitd775cef639649be13a99c4d42fb7abda69ea7d09
tree698c3d229d7114ec8bbe74a6abde2bc48c16acba
parentc2b0b6f4517f5f5a7ea6a3abd6d235068675e32e
Use only one global variable for snapshot creation pids.

There's no need to have pre_create_hook_pid, rsync_pid and
post_create_hook_pid because only one of them can be running at
any point in time. We can always tell which it is by examining the
snapshot_creation_status.

So replace these three variables by the single create_pid variable.

Besides of killing two global variables, this change also fixes a
real bug: If the dss process catches SIGINT or SIGTERM, the old code
would only kill a running rsync process but not the pre-create or
post-create hook. However, the new code kills whatever create process
is currently running, which is the right thing to do.
dss.c