Lookup a script in the scripts queue via pid, and returns the list node * (so that we can easily remove it from the queue if needed). */
| 825 | /* Lookup a script in the scripts queue via pid, and returns the list node |
| 826 | * (so that we can easily remove it from the queue if needed). */ |
| 827 | listNode *sentinelGetScriptListNodeByPid(pid_t pid) { |
| 828 | listNode *ln; |
| 829 | listIter li; |
| 830 | |
| 831 | listRewind(sentinel.scripts_queue,&li); |
| 832 | while ((ln = listNext(&li)) != NULL) { |
| 833 | sentinelScriptJob *sj = ln->value; |
| 834 | |
| 835 | if ((sj->flags & SENTINEL_SCRIPT_RUNNING) && sj->pid == pid) |
| 836 | return ln; |
| 837 | } |
| 838 | return NULL; |
| 839 | } |
| 840 | |
| 841 | /* Run pending scripts if we are not already at max number of running |
| 842 | * scripts. */ |
no test coverage detected