Commit 7c7d50fb authored by Pavel Emelyanov's avatar Pavel Emelyanov

util-fd: Use standard BUG_ON instead of hand-made

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 0328d33e
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#include "util-pie.h" #include "util-pie.h"
#include "fcntl.h" #include "fcntl.h"
#include "bug.h"
static void scm_fdset_init_chunk(struct scm_fdset *fdset, int nr_fds) static void scm_fdset_init_chunk(struct scm_fdset *fdset, int nr_fds)
{ {
struct cmsghdr *cmsg; struct cmsghdr *cmsg;
...@@ -153,8 +155,8 @@ int recv_fds(int sock, int *fds, int nr_fds, struct fd_opts *opts) ...@@ -153,8 +155,8 @@ int recv_fds(int sock, int *fds, int nr_fds, struct fd_opts *opts)
* into files which do not have glibc and a couple of * into files which do not have glibc and a couple of
* sys_write_ helpers. Meawhile opencoded BUG_ON here. * sys_write_ helpers. Meawhile opencoded BUG_ON here.
*/ */
if (unlikely(min_fd > CR_SCM_MAX_FD)) BUG_ON(min_fd > CR_SCM_MAX_FD);
*(volatile unsigned long *)NULL = 0xdead0000 + __LINE__;
if (unlikely(min_fd <= 0)) if (unlikely(min_fd <= 0))
return -1; return -1;
builtin_memcpy(&fds[i], cmsg_data, sizeof(int) * min_fd); builtin_memcpy(&fds[i], cmsg_data, sizeof(int) * min_fd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment