Delete fork_tcb()
Get rid of fork_tcb() function. It used to do what the comment
above it says, but now it doesn't do much:
it only sets tcp->flags |= TCB_FOLLOWFORK and maybe calls
expand_tcbtab(). The second operation is not necessary, since
alloc_tcp() will do it itself when needed.
This patch deletes fork_tcb(), open-coding tcp->flags |= TCB_FOLLOWFORK
where it was formerly called. It also makes nprocs, tcbtabsize and
expand_tcbtab() static. (While at it, I nuked redundant
extern char **environ declaration: strace.c had *two* of them...)
* defs.h: Remove declarations of nprocs, tcbtabsize and
expand_tcbtab.
* process.c (fork_tcb): Remove this function.
(internal_fork): Open-code fork_tcb.
(handle_new_child): Likewise.
* strace.c: Remove redundant "extern char **environ". Declare
nprocs and tcbtabsize static.
(expand_tcbtab): Make it static.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
diff --git a/strace.c b/strace.c
index 3b39371..84fc1b7 100644
--- a/strace.c
+++ b/strace.c
@@ -127,9 +127,8 @@
FILE *outf;
static int curcol;
struct tcb **tcbtab;
-unsigned int nprocs, tcbtabsize;
+static unsigned int nprocs, tcbtabsize;
const char *progname;
-extern char **environ;
static int detach(struct tcb *tcp, int sig);
static int trace(void);
@@ -1244,7 +1243,7 @@
exit(exit_code);
}
-void
+static void
expand_tcbtab(void)
{
/* Allocate some more TCBs and expand the table.