cansniffer: unify setsockopt error handling
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>pull/486/head
parent
7affaf217e
commit
c31addfa9c
|
|
@ -302,7 +302,11 @@ int main(int argc, char **argv)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
setsockopt(s, SOL_CAN_ISOTP, CAN_ISOTP_OPTS, &opts, sizeof(opts));
|
if (setsockopt(s, SOL_CAN_ISOTP, CAN_ISOTP_OPTS, &opts, sizeof(opts)) < 0) {
|
||||||
|
perror("setsockopt");
|
||||||
|
r = 1;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
if ((llopts.mtu) && (setsockopt(s, SOL_CAN_ISOTP, CAN_ISOTP_LL_OPTS, &llopts, sizeof(llopts))) < 0) {
|
if ((llopts.mtu) && (setsockopt(s, SOL_CAN_ISOTP, CAN_ISOTP_LL_OPTS, &llopts, sizeof(llopts))) < 0) {
|
||||||
perror("setsockopt");
|
perror("setsockopt");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue