mirror of
https://gitlab.com/etherlab.org/ethercat.git
synced 2026-08-17 16:51:44 +08:00
Avoid race condition when starting master
By first removing the non-native driver module and then checking for success. It's better to ask for forgiveness than to ask for permission.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user