diff options
author | Eric Paris <eparis@redhat.com> | 2012-11-29 09:41:38 -0500 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2013-02-05 20:14:45 -0500 |
commit | aa62cd60f7192123b509c2518e7a2083e34a65a2 (patch) | |
tree | b2dfbf0d25bacffdd62248b38db322be98c213af /libselinux/src/avc_internal.c | |
parent | afe88d8c69543b2ebd6e25efdaab76f40ea4d3c7 (diff) | |
download | android_external_selinux-aa62cd60f7192123b509c2518e7a2083e34a65a2.tar.gz android_external_selinux-aa62cd60f7192123b509c2518e7a2083e34a65a2.tar.bz2 android_external_selinux-aa62cd60f7192123b509c2518e7a2083e34a65a2.zip |
libselinux: Fix errors found by coverity
Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
Diffstat (limited to 'libselinux/src/avc_internal.c')
-rw-r--r-- | libselinux/src/avc_internal.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libselinux/src/avc_internal.c b/libselinux/src/avc_internal.c index 6d508eeb..f735e73d 100644 --- a/libselinux/src/avc_internal.c +++ b/libselinux/src/avc_internal.c @@ -60,13 +60,12 @@ int avc_netlink_open(int blocking) int len, rc = 0; struct sockaddr_nl addr; - fd = socket(PF_NETLINK, SOCK_RAW, NETLINK_SELINUX); + fd = socket(PF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_SELINUX); if (fd < 0) { rc = fd; goto out; } - fcntl(fd, F_SETFD, FD_CLOEXEC); if (!blocking && fcntl(fd, F_SETFL, O_NONBLOCK)) { close(fd); fd = -1; |