[dpdk-dev] [PATCH V4 5/9] bus: add helper to handle sigbus
Ananyev, Konstantin
konstantin.ananyev at intel.com
Fri Jun 29 12:51:27 CEST 2018
> +int
> +rte_bus_sigbus_handler(const void *failure_addr)
> +{
> + struct rte_bus *bus;
> + int old_errno = rte_errno;
> + int ret = 0;
> +
> + rte_errno = 0;
> +
> + bus = rte_bus_find(NULL, bus_handle_sigbus, failure_addr);
> + if (bus == NULL) {
> + RTE_LOG(ERR, EAL, "No bus can handle the sigbus error!");
> + ret = -1;
> + } else if (rte_errno != 0) {
> + RTE_LOG(ERR, EAL, "Failed to handle the sigbus error!");
> + ret = -1;
> + }
> +
> + /* if sigbus not be handled, return back old errno. */
> + if (ret)
> + rte_errno = old_errno;
Hmm, not sure why we need to set/restore rte_errno here?
> +
> + return ret;
> +}
More information about the dev
mailing list