summaryrefslogtreecommitdiff
path: root/Src/linklist.c
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2014-10-26 17:47:42 +0000
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2014-10-26 17:47:42 +0000
commitb4f7ccecd93ca9e64c3c3c774fdaefae83d7204a (patch)
tree492ba48008b5fa2c9370a7f4695540d6b8c7e89f /Src/linklist.c
parente18b5bf0b2a1409ba5c88f8b61dbf65cdc235027 (diff)
downloadzsh-b4f7ccecd93ca9e64c3c3c774fdaefae83d7204a.tar.gz
zsh-b4f7ccecd93ca9e64c3c3c774fdaefae83d7204a.zip
33531 with additions: retain status of exited background jobs.
Add linked list of unwaited-for background jobs. Truncate at value of _SC_CHILD_MAX discarding oldest. Remove old lastpid_status mechanism for latest exited process only. Slightly tighten safety of permanently allocated linked lists so that this doesn't compromise signal handling.
Diffstat (limited to 'Src/linklist.c')
-rw-r--r--Src/linklist.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Src/linklist.c b/Src/linklist.c
index 1e364fb4e..3aa8125d9 100644
--- a/Src/linklist.c
+++ b/Src/linklist.c
@@ -118,6 +118,8 @@ znewlinklist(void)
LinkList list;
list = (LinkList) zalloc(sizeof *list);
+ if (!list)
+ return NULL;
list->list.first = NULL;
list->list.last = &list->node;
list->list.flags = 0;
@@ -152,6 +154,8 @@ zinsertlinknode(LinkList list, LinkNode node, void *dat)
tmp = node->next;
node->next = new = (LinkNode) zalloc(sizeof *tmp);
+ if (!new)
+ return NULL;
new->prev = node;
new->dat = dat;
new->next = tmp;