parameters: remove unnecessary duplicated shutdown lock in param_save_default()

- param_export already takes the shutdown lock
This commit is contained in:
Daniel Agar 2020-12-16 10:50:05 -05:00 committed by GitHub
parent c7db0942ba
commit a152fb65cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -979,22 +979,12 @@ int param_save_default()
return res;
}
int shutdown_lock_ret = px4_shutdown_lock();
if (shutdown_lock_ret) {
PX4_ERR("px4_shutdown_lock() failed (%i)", shutdown_lock_ret);
}
/* write parameters to temp file */
int fd = PARAM_OPEN(filename, O_WRONLY | O_CREAT, PX4_O_MODE_666);
if (fd < 0) {
PX4_ERR("failed to open param file: %s", filename);
if (shutdown_lock_ret == 0) {
px4_shutdown_unlock();
}
return PX4_ERROR;
}
@ -1016,10 +1006,6 @@ int param_save_default()
PARAM_CLOSE(fd);
if (shutdown_lock_ret == 0) {
px4_shutdown_unlock();
}
return res;
}