Merge branch 'startup_race_condition' into 'stable-1.5'

Avoid race condition when starting master

See merge request etherlab.org/ethercat!93
This commit is contained in:
Florian Pose 2023-11-22 15:55:30 +00:00
commit 1ce30543dd
1 changed files with 5 additions and 5 deletions

View File

@ -126,12 +126,12 @@ start)
fi
if [ "${MODULE}" != "generic" ] && [ "${MODULE}" != "ccat" ]; then
# try to unload standard module
# unload standard module and check if unloading was successful
${RMMOD} "${MODULE}" 2> /dev/null || true
if ${LSMOD} | grep "^${MODULE} " > /dev/null; then
if ! ${RMMOD} "${MODULE}"; then
${RMMOD} ${LOADED_MODULES}
exit 1
fi
# could not unload module
${RMMOD} ${LOADED_MODULES}
exit 1
fi
fi