Skip to content

Commit

Permalink
Flag reset fixed; print flags as hexa
Browse files Browse the repository at this point in the history
(cherry picked from commit 34d98d8)
  • Loading branch information
bogdan-iancu committed Jul 3, 2017
1 parent 0121d89 commit 24de221
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions io_wait.h
Expand Up @@ -277,7 +277,7 @@ static inline int kq_ev_change(io_wait_h* h, int fd, int filter, int flag,
if (_e->type==0 || _e->fd<=0 || \
(_e->flags&(IO_WATCH_READ|IO_WATCH_WRITE))==0 ) {\
LM_BUG("fd_array idx %d (fd=%d) points to bogus map "\
"(fd=%d,type=%d,flags=%d,data=%p)\n",k,h->fd_array[k].fd,\
"(fd=%d,type=%d,flags=%x,data=%p)\n",k,h->fd_array[k].fd,\
_e->fd, _e->type, _e->flags, _e->data);\
check_error = 1;\
}\
Expand All @@ -291,7 +291,7 @@ static inline int kq_ev_change(io_wait_h* h, int fd, int filter, int flag,
/* fd not in used, everything should be on zero */ \
if (_e->fd>0 || _e->data!=NULL || _e->flags!=0 ) {\
LM_BUG("unused fd_map fd=%d has bogus data "\
"(fd=%d,flags=%d,data=%p)\n",k,\
"(fd=%d,flags=%x,data=%p)\n",k,\
_e->fd, _e->flags, _e->data);\
check_error = 1;\
}\
Expand All @@ -300,18 +300,18 @@ static inline int kq_ev_change(io_wait_h* h, int fd, int filter, int flag,
if (_e->fd<=0 || \
(_e->flags&(IO_WATCH_READ|IO_WATCH_WRITE))==0 ) {\
LM_BUG("used fd map fd=%d has bogus data "\
"(fd=%d,type=%d,flags=%d,data=%p)\n",k,\
"(fd=%d,type=%d,flags=%x,data=%p)\n",k,\
_e->fd, _e->type, _e->flags, _e->data);\
check_error = 1;\
}\
/* the map is valid */ \
if ((_e->flags&IO_WATCH_PRV_CHECKED)==0) {\
LM_BUG("used fd map fd=%d is not present in fd_array "\
"(fd=%d,type=%d,flags=%d,data=%p)\n",k,\
"(fd=%d,type=%d,flags=%x,data=%p)\n",k,\
_e->fd, _e->type, _e->flags, _e->data);\
check_error = 1;\
}\
_e->flags |= ~IO_WATCH_PRV_CHECKED;\
_e->flags &= ~IO_WATCH_PRV_CHECKED;\
_t++;\
}\
}\
Expand Down Expand Up @@ -590,7 +590,7 @@ inline static int io_watch_add( io_wait_h* h,
check_io_data();
if (check_error) {
LM_CRIT("[%s] check failed after succesfull fd add "
"(fd=%d,type=%d,data=%p,flags=%d) already=%d\n",h->name,
"(fd=%d,type=%d,data=%p,flags=%x) already=%d\n",h->name,
fd, type, data, flags, already);
}
return 0;
Expand All @@ -600,7 +600,7 @@ inline static int io_watch_add( io_wait_h* h,
check_io_data();
if (check_error) {
LM_CRIT("[%s] check failed after failed fd add "
"(fd=%d,type=%d,data=%p,flags=%d) already=%d\n",h->name,
"(fd=%d,type=%d,data=%p,flags=%x) already=%d\n",h->name,
fd, type, data, flags, already);
}
return -1;
Expand Down
6 changes: 3 additions & 3 deletions io_wait_loop.h
Expand Up @@ -176,7 +176,7 @@ inline static int io_wait_loop_epoll(io_wait_h* h, int t, int repeat)
e = ((struct fd_map*)h->ep_array[r].data.ptr);
if (e->type==0 || e->fd<=0 || (e->flags&(IO_WATCH_READ|IO_WATCH_WRITE))==0 ) {
LM_BUG("[%s] unset/bogus map triggered for %d by epoll "
"(fd=%d,type=%d,flags=%d,data=%p)\n",h->name,
"(fd=%d,type=%d,flags=%x,data=%p)\n",h->name,
h->ep_array[r].events,
e->fd, e->type, e->flags, e->data);
}
Expand All @@ -185,7 +185,7 @@ inline static int io_wait_loop_epoll(io_wait_h* h, int t, int repeat)
if (h->ep_array[r].events & EPOLLIN) {
if ((e->flags&IO_WATCH_READ)==0) {
LM_BUG("[%s] EPOLLIN triggered(%d) for non-read fd_map "
"(fd=%d,type=%d,flags=%d,data=%p)\n",h->name,
"(fd=%d,type=%d,flags=%x,data=%p)\n",h->name,
h->ep_array[r].events,
e->fd, e->type, e->flags, e->data);
}
Expand All @@ -201,7 +201,7 @@ inline static int io_wait_loop_epoll(io_wait_h* h, int t, int repeat)
} else if (h->ep_array[r].events & EPOLLOUT){
if ((e->flags&IO_WATCH_WRITE)==0) {
LM_BUG("[%s] EPOLLOUT triggered(%d) for non-read fd_map "
"(fd=%d,type=%d,flags=%d,data=%p)\n",h->name,
"(fd=%d,type=%d,flags=%x,data=%p)\n",h->name,
h->ep_array[r].events,
e->fd, e->type, e->flags, e->data);
}
Expand Down

0 comments on commit 24de221

Please sign in to comment.