• 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:
4
exec.c
4
exec.c
@ -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));
|
||||
}
|
||||
|
Reference in New Issue
Block a user