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