• alloc() can’t fail, afree() can take NULL

‣ macro afreechk() is superfluous
• get rid of macro afreechv() by re-doing the “don’t leak that much” code
• some KNF (mostly, whitespace and 80c) while here
This commit is contained in:
tg
2008-05-17 18:47:03 +00:00
parent b41a72ac2e
commit f17b8b1c8b
14 changed files with 77 additions and 93 deletions

4
exec.c
View File

@ -2,7 +2,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.43 2008/04/19 22:15:02 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.44 2008/05/17 18:46:58 tg Exp $");
static int comexec(struct op *, struct tbl *volatile, const char **,
int volatile);
@ -72,7 +72,7 @@ execute(struct op *volatile t,
flags &= ~XTIME;
if (t->ioact != NULL || t->type == TPIPE || t->type == TCOPROC) {
e->savefd = (short *) alloc(sizeofN(short, NUFILE), ATEMP);
e->savefd = (short *)alloc(sizeofN(short, NUFILE), ATEMP);
/* initialise to not redirected */
memset(e->savefd, 0, sizeofN(short, NUFILE));
}