From: Roland McGrath Date: Wed, 8 Jun 2005 20:45:28 +0000 (+0000) Subject: 2005-06-08 Dmitry V. Levin X-Git-Tag: v4.5.18~361 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a4d4853f679014799a6608cc8114e6ce7f37ae89;p=strace 2005-06-08 Dmitry V. Levin Minor namespace cleanup. * defs.h (string_quote): Remove declaration. * file.c (openmodessol) [LINUXSPARC]: Make static. (fileflags): Likewise. (aclcmds, aclipc) [HAVE_SYS_ACL_H]: Likewise. (direnttypes) [FREEBSD || LINUX]: Likewise. (xattrflags): Likewise. * process.c (unalignctl_string): Make static. (setarg): Disable. * syscall.c (subcalls_table): Make static. (socket_map) [!(LINUX && (ALPHA || MIPS))]: Likewise. (sparc_socket_decode): Make static, define for [SPARC || SPARC64] only. (decode_subcall): Make static. (syscall_fixup): Likewise. (get_error): Likewise. (syscall_enter): Likewise. * util.c (tv_tv): Disable. (getpc): Likewise. (string_quote): Make static. Fixes RH#159688. --- diff --git a/defs.h b/defs.h index 24cf19cd..89eaddbe 100644 --- a/defs.h +++ b/defs.h @@ -435,7 +435,6 @@ extern int umovestr P((struct tcb *, long, int, char *)); extern int upeek P((int, long, long *)); extern void dumpiov P((struct tcb *, int, long)); extern void dumpstr P((struct tcb *, long, int)); -extern void string_quote P((char *str)); extern void printstr P((struct tcb *, long, int)); extern void printnum P((struct tcb *, long, char *)); extern void printpath P((struct tcb *, long)); diff --git a/file.c b/file.c index db6b60ae..dd825b0f 100644 --- a/file.c +++ b/file.c @@ -325,7 +325,7 @@ struct tcb *tcp; } #ifdef LINUXSPARC -const struct xlat openmodessol[] = { +static const struct xlat openmodessol[] = { { 0, "O_RDWR" }, { 1, "O_RDONLY" }, { 2, "O_WRONLY" }, @@ -753,7 +753,7 @@ long addr; #endif /* SPARC64 */ #endif /* LINUXSPARC */ -const struct xlat fileflags[] = { +static const struct xlat fileflags[] = { #ifdef FREEBSD { UF_NODUMP, "UF_NODUMP" }, { UF_IMMUTABLE, "UF_IMMUTABLE" }, @@ -1296,7 +1296,7 @@ struct tcb *tcp; #include -const struct xlat aclcmds[] = { +static const struct xlat aclcmds[] = { #ifdef SETACL { SETACL, "SETACL" }, #endif @@ -1361,7 +1361,7 @@ struct tcb *tcp; } -const struct xlat aclipc[] = { +static const struct xlat aclipc[] = { #ifdef IPC_SHM { IPC_SHM, "IPC_SHM" }, #endif @@ -1987,7 +1987,7 @@ struct tcb *tcp; #endif /* LINUX */ #if defined FREEBSD || defined LINUX -const struct xlat direnttypes[] = { +static const struct xlat direnttypes[] = { { DT_UNKNOWN, "DT_UNKNOWN" }, { DT_FIFO, "DT_FIFO" }, { DT_CHR, "DT_CHR" }, @@ -2323,7 +2323,7 @@ struct tcb *tcp; #endif /* HAVE_SYS_ASYNCH_H */ -const struct xlat xattrflags[] = { +static const struct xlat xattrflags[] = { #ifdef XATTR_CREATE { XATTR_CREATE, "XATTR_CREATE" }, { XATTR_REPLACE, "XATTR_REPLACE" }, diff --git a/process.c b/process.c index 2d8cb0ae..f9cffe42 100644 --- a/process.c +++ b/process.c @@ -220,7 +220,7 @@ static const struct xlat prctl_options[] = { }; -const char * +static const char * unalignctl_string (unsigned int ctl) { static char buf[16]; @@ -701,6 +701,7 @@ int new; return -1; } +#if 0 int setarg(tcp, argnum) struct tcb *tcp; @@ -778,6 +779,7 @@ setarg(tcp, argnum) #endif return 0; } +#endif #if defined SYS_clone || defined SYS_clone2 int diff --git a/syscall.c b/syscall.c index 34fc0721..675b3f4f 100644 --- a/syscall.c +++ b/syscall.c @@ -513,7 +513,7 @@ struct subcall { int subcalls[5]; }; -const struct subcall subcalls_table[] = { +static const struct subcall subcalls_table[] = { { SYS_shmsys, 5, { SYS_shmat, SYS_shmctl, SYS_shmdt, SYS_shmget, SYS_shmctl } }, #ifdef SYS_semconfig { SYS_semsys, 4, { SYS___semctl, SYS_semget, SYS_semop, SYS_semconfig } }, @@ -526,7 +526,7 @@ const struct subcall subcalls_table[] = { #if !(defined(LINUX) && ( defined(ALPHA) || defined(MIPS) )) -const int socket_map [] = { +static const int socket_map [] = { /* SYS_SOCKET */ 97, /* SYS_BIND */ 104, /* SYS_CONNECT */ 98, @@ -546,7 +546,8 @@ const int socket_map [] = { /* SYS_RECVMSG */ 113 }; -void +#if defined (SPARC) || defined (SPARC64) +static void sparc_socket_decode (tcp) struct tcb *tcp; { @@ -567,8 +568,9 @@ struct tcb *tcp; addr += sizeof (arg); } } +#endif -void +static void decode_subcall(tcp, subcall, nsubcalls, style) struct tcb *tcp; int subcall; @@ -1277,7 +1279,7 @@ struct tcb *tcp; return scno; } -int +static int syscall_fixup(tcp) struct tcb *tcp; { @@ -1421,7 +1423,7 @@ struct tcb *tcp; return 1; } -int +static int get_error(tcp) struct tcb *tcp; { @@ -1855,7 +1857,8 @@ force_result(tcp, error, rval) return 0; } -int syscall_enter(tcp) +static int +syscall_enter(tcp) struct tcb *tcp; { #ifndef USE_PROCFS diff --git a/util.c b/util.c index a5ade417..d65f42ce 100644 --- a/util.c +++ b/util.c @@ -148,6 +148,7 @@ static _hack_syscall5(int,_ptrace,int,__request,int,__pid,int,__addr,int,__data, #define MIN(a,b) (((a) < (b)) ? (a) : (b)) #endif +#if 0 void tv_tv(tv, a, b) struct timeval *tv; @@ -157,6 +158,7 @@ int b; tv->tv_sec = a; tv->tv_usec = b; } +#endif int tv_nz(a) @@ -358,9 +360,9 @@ unsigned long uid; static char path[MAXPATHLEN + 1]; -void +static void string_quote(str) -char *str; +const char *str; { char buf[2 * MAXPATHLEN + 1]; char *s; @@ -976,6 +978,7 @@ long *res; #endif /* !USE_PROCFS */ +#if 0 long getpc(tcp) struct tcb *tcp; @@ -1053,6 +1056,7 @@ struct tcb *tcp; return regs.r_eip; #endif /* FREEBSD */ } +#endif void printcall(tcp)