mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
tools: hv: Check return value of setsockopt call
Check return value of setsockopt call and if it fails print error to the system log and exit with non-zero value. Signed-off-by: Tomas Hozza <[email protected]> Acked-by: K. Y. Srinivasan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
98b80d8938
commit
3590160322
1 changed files with 7 additions and 1 deletions
|
|
@ -1457,7 +1457,13 @@ int main(void)
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
nl_group = CN_KVP_IDX;
|
||||
setsockopt(fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &nl_group, sizeof(nl_group));
|
||||
|
||||
if (setsockopt(fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &nl_group, sizeof(nl_group)) < 0) {
|
||||
syslog(LOG_ERR, "setsockopt failed; error: %d %s", errno, strerror(errno));
|
||||
close(fd);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Register ourselves with the kernel.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue