Skip to content

Commit

Permalink
preload: Abort on ioctl communication error
Browse files Browse the repository at this point in the history
Aborting has the advantage that it will trigger a core-dump, simplifying
debugging.
  • Loading branch information
Benjamin Berg authored and martinpitt committed Jun 30, 2021
1 parent 5e2e428 commit f694ac8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libumockdev-preload.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,25 +645,25 @@ remote_emulate(int fd, int cmd, long arg1, long arg2)
case IOCTL_RES_ABORT:
fprintf(stderr, "ERROR: libumockdev-preload: Server requested abort on device %s, exiting\n",
fdinfo->dev_path);
exit(1);
abort();

default:
fprintf(stderr, "ERROR: libumockdev-preload: Error communicating with ioctl socket, unknown command: %ld (res: %d)\n",
req.cmd, res);
exit(1);
abort();
}
}

con_eof:
fprintf(stderr, "ERROR: libumockdev-preload: Error communicating with ioctl socket, received EOF\n");
pthread_sigmask(SIG_SETMASK, &sig_restore, NULL);
exit(1);
abort();

con_err:
fprintf(stderr, "ERROR: libumockdev-preload: Error communicating with ioctl socket, errno: %d\n",
errno);
pthread_sigmask(SIG_SETMASK, &sig_restore, NULL);
exit(1);
abort();
}

/********************************
Expand Down

0 comments on commit f694ac8

Please sign in to comment.