mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
parameters: remove unnecessary duplicated shutdown lock in param_save_default()
- param_export already takes the shutdown lock
This commit is contained in:
@@ -979,22 +979,12 @@ int param_save_default()
|
|||||||
return res;
|
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 */
|
/* write parameters to temp file */
|
||||||
int fd = PARAM_OPEN(filename, O_WRONLY | O_CREAT, PX4_O_MODE_666);
|
int fd = PARAM_OPEN(filename, O_WRONLY | O_CREAT, PX4_O_MODE_666);
|
||||||
|
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
PX4_ERR("failed to open param file: %s", filename);
|
PX4_ERR("failed to open param file: %s", filename);
|
||||||
|
|
||||||
if (shutdown_lock_ret == 0) {
|
|
||||||
px4_shutdown_unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
return PX4_ERROR;
|
return PX4_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1016,10 +1006,6 @@ int param_save_default()
|
|||||||
|
|
||||||
PARAM_CLOSE(fd);
|
PARAM_CLOSE(fd);
|
||||||
|
|
||||||
if (shutdown_lock_ret == 0) {
|
|
||||||
px4_shutdown_unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user