local sysfspath="$4"
# Do not save virtual devices
- local virtual
+ local virtual result
virtual="$(echo "$sysfspath" | cut -d'/' -f4)"
[ "$virtual" = "virtual" ] && {
mm_log "debug" "sysfspath is a virtual device ($sysfspath)"
esac
# Report the event
- mm_log "debug" "event reported: action=${action}, name=${name}, subsystem=${subsystem}"
- mmcli --report-kernel-event="action=${action},name=${name},subsystem=${subsystem}" 1>/dev/null 2>&1 &
+ mm_log "debug" "Report event: action=${action}, name=${name}, subsystem=${subsystem}"
+ result=$(mmcli --report-kernel-event="action=${action},name=${name},subsystem=${subsystem}" 2>&1)
+ if [ "$?" -eq "0" ]; then
+ # Wait for added modem if a sysfspath is given
+ [ -n "${sysfspath}" ] && [ "$action" = "add" ] && mm_report_modem_wait "${sysfspath}"
+ else
+ mm_log "error" "Couldn't report kernel event: ${result}"
+ fi
- # Wait for added modem if a sysfspath is given
- [ -n "${sysfspath}" ] && [ "$action" = "add" ] && mm_report_modem_wait "${sysfspath}"
}
mm_report_event_from_cache_line() {