From 81b065a95d670ef357c36239d8c408cd72a5c48c Mon Sep 17 00:00:00 2001 From: Jiangli Zhou Date: Tue, 27 Feb 2024 16:43:37 +0000 Subject: [PATCH] 8326714: Make file-local functions static in src/java.base/unix/native/libjava/childproc.c Reviewed-by: djelinski, rriggs --- src/java.base/unix/native/libjava/childproc.c | 14 +++++++------- src/java.base/unix/native/libjava/childproc.h | 13 ------------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/java.base/unix/native/libjava/childproc.c b/src/java.base/unix/native/libjava/childproc.c index 175128e4f63..52769ec642f 100644 --- a/src/java.base/unix/native/libjava/childproc.c +++ b/src/java.base/unix/native/libjava/childproc.c @@ -36,7 +36,7 @@ const char * const *parentPathv; -int +static int restartableDup2(int fd_from, int fd_to) { int err; @@ -50,7 +50,7 @@ closeSafely(int fd) return (fd == -1) ? 0 : close(fd); } -int +static int isAsciiDigit(char c) { return c >= '0' && c <= '9'; @@ -65,7 +65,7 @@ isAsciiDigit(char c) #define FD_DIR "/proc/self/fd" #endif -int +static int closeDescriptors(void) { DIR *dp; @@ -103,7 +103,7 @@ closeDescriptors(void) return 1; } -int +static int moveDescriptor(int fd_from, int fd_to) { if (fd_from != fd_to) { @@ -209,7 +209,7 @@ initVectorFromBlock(const char**vector, const char* block, int count) * misfeature, but compatibility wins over sanity. The original support for * this was imported accidentally from execvp(). */ -void +static void execve_as_traditional_shell_script(const char *file, const char *argv[], const char *const envp[]) @@ -232,7 +232,7 @@ execve_as_traditional_shell_script(const char *file, * Like execve(2), except that in case of ENOEXEC, FILE is assumed to * be a shell script and the system default shell is invoked to run it. */ -void +static void execve_with_shell_fallback(int mode, const char *file, const char *argv[], const char *const envp[]) @@ -256,7 +256,7 @@ execve_with_shell_fallback(int mode, const char *file, * JDK_execvpe is identical to execvp, except that the child environment is * specified via the 3rd argument instead of being inherited from environ. */ -void +static void JDK_execvpe(int mode, const char *file, const char *argv[], const char *const envp[]) diff --git a/src/java.base/unix/native/libjava/childproc.h b/src/java.base/unix/native/libjava/childproc.h index e39126aa119..49026b388c9 100644 --- a/src/java.base/unix/native/libjava/childproc.h +++ b/src/java.base/unix/native/libjava/childproc.h @@ -128,24 +128,11 @@ typedef struct _SpawnInfo { extern const char * const *parentPathv; ssize_t writeFully(int fd, const void *buf, size_t count); -int restartableDup2(int fd_from, int fd_to); int closeSafely(int fd); -int isAsciiDigit(char c); -int closeDescriptors(void); -int moveDescriptor(int fd_from, int fd_to); int magicNumber(); ssize_t readFully(int fd, void *buf, size_t nbyte); void initVectorFromBlock(const char**vector, const char* block, int count); -void execve_as_traditional_shell_script(const char *file, - const char *argv[], - const char *const envp[]); -void execve_with_shell_fallback(int mode, const char *file, - const char *argv[], - const char *const envp[]); -void JDK_execvpe(int mode, const char *file, - const char *argv[], - const char *const envp[]); int childProcess(void *arg); #ifdef DEBUG