| 311 | } |
| 312 | |
| 313 | bool KqueueProxy::KqueueAddObj(KqueuerObj* obj) |
| 314 | { |
| 315 | if (obj == NULL) |
| 316 | { |
| 317 | MTLOG_ERROR("kqobj input invalid, %p", obj); |
| 318 | return false; |
| 319 | } |
| 320 | |
| 321 | KqFdRef* item = KqFdRefGet(obj->GetOsfd()); |
| 322 | if (item == NULL) |
| 323 | { |
| 324 | MT_ATTR_API(320851, 1); // fd error |
| 325 | MTLOG_ERROR("kqfd ref not find, failed, fd: %d", obj->GetOsfd()); |
| 326 | kqueue_assert(0); |
| 327 | return false; |
| 328 | } |
| 329 | |
| 330 | int ret = obj->KqueueCtlAdd(item); |
| 331 | if (ret < 0) { |
| 332 | MTLOG_ERROR("kqueue ctrl callback failed, fd: %d, obj: %p", obj->GetOsfd(), obj); |
| 333 | kqueue_assert(0); |
| 334 | return false; |
| 335 | } |
| 336 | |
| 337 | return true; |
| 338 | } |
| 339 | |
| 340 | bool KqueueProxy::KqueueDelObj(KqueuerObj* obj) |
| 341 | { |
no test coverage detected