mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-30 03:47:05 -05:00
Avoid saving the content file in touch if nothing changed
This commit is contained in:
parent
e4aa186b1a
commit
bf2657b76a
2 changed files with 30 additions and 6 deletions
|
|
@ -1903,11 +1903,18 @@ int snapraid_main(int argc, char* argv[])
|
|||
} else if (operation == OPERATION_REHASH) {
|
||||
state_read(&state);
|
||||
|
||||
/* intercept signals while operating */
|
||||
signal_init();
|
||||
|
||||
state_rehash(&state);
|
||||
|
||||
/*
|
||||
* Intercept signals while operating
|
||||
*
|
||||
* Intentionally do this after the touch operation.
|
||||
*
|
||||
* The signal protection is meant only for saving the content file,
|
||||
* or an early stop of long operations.
|
||||
*/
|
||||
signal_init();
|
||||
|
||||
/* save the new state if required */
|
||||
if (state.need_write)
|
||||
state_write(&state);
|
||||
|
|
@ -1945,10 +1952,18 @@ int snapraid_main(int argc, char* argv[])
|
|||
|
||||
state_touch(&state);
|
||||
|
||||
/* intercept signals while operating */
|
||||
/*
|
||||
* Intercept signals while operating
|
||||
*
|
||||
* Intentionally do this after the touch operation.
|
||||
*
|
||||
* The signal protection is meant only for saving the content file,
|
||||
* or an early stop of long operations.
|
||||
*/
|
||||
signal_init();
|
||||
|
||||
state_write(&state);
|
||||
if (state.need_write)
|
||||
state_write(&state);
|
||||
} else if (operation == OPERATION_SPINUP) {
|
||||
ret = state_device(&state, DEVICE_UP, &filterlist_disk);
|
||||
#if HAVE_CHECKER
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue