author | Olivier Brunel
<jjk@jjacky.com> 2017-01-27 19:00:57 UTC |
committer | Olivier Brunel
<jjk@jjacky.com> 2017-06-18 12:30:35 UTC |
parent | 35f2755d8e6f07bb59e8f796a0eef54b65f4abe4 |
src/libanopa/exec_longrun.c | +1 | -26 |
diff --git a/src/libanopa/exec_longrun.c b/src/libanopa/exec_longrun.c index a05988b..c620f2a 100644 --- a/src/libanopa/exec_longrun.c +++ b/src/libanopa/exec_longrun.c @@ -248,33 +248,8 @@ aa_get_longrun_info (uint16 *id, char *event) int aa_unsubscribe_for (uint16 id) { - int r = 0; tain_t deadline; tain_addsec_g (&deadline, 1); - if (!ftrigr_unsubscribe_g (&_aa_ft, id, &deadline)) - r = -1; - /* if it works, we need to remove any future iteration of that id in the - * _aa_ft.list, to avoid EINVAL from ftrigr_check() in aa_get_longrun_info() - * above, as more of this id could have been listed */ - if (r == 0 && idx >= 0) - { - int i = genalloc_len (uint16, &_aa_ft.list); - - for (--i; i >= idx; --i) - { - if (genalloc_s (uint16, &_aa_ft.list)[i] == id) - { - int len = genalloc_len (uint16, &_aa_ft.list); - int c = len - i - 1; - - if (c > 0) - byte_copy (genalloc_s (uint16, &_aa_ft.list) + i, - c * sizeof (uint16), - genalloc_s (uint16, &_aa_ft.list) + i + 1); - genalloc_setlen (uint16, &_aa_ft.list, len - 1); - } - } - } - return r; + return (ftrigr_unsubscribe_g (&_aa_ft, id, &deadline)) ? 0 : -1; }