| 445 | } |
| 446 | |
| 447 | struct fs_event *add_event(fs_evs *sock, const str *name) |
| 448 | { |
| 449 | struct fs_event *event; |
| 450 | |
| 451 | event = shm_malloc(sizeof *event); |
| 452 | if (!event) { |
| 453 | LM_ERR("oom\n"); |
| 454 | return NULL; |
| 455 | } |
| 456 | memset(event, 0, sizeof *event); |
| 457 | |
| 458 | if (dup_common_tag(name, &event->name) != 0) { |
| 459 | shm_free(event); |
| 460 | LM_ERR("oom\n"); |
| 461 | return NULL; |
| 462 | } |
| 463 | |
| 464 | event->action = FS_EVENT_SUB; |
| 465 | INIT_LIST_HEAD(&event->subscriptions); |
| 466 | |
| 467 | list_add_tail(&event->list, &sock->events); |
| 468 | return event; |
| 469 | } |
| 470 | |
| 471 | struct fs_event *get_event(fs_evs *sock, const str *name) |
| 472 | { |
no test coverage detected