8326714: Make file-local functions static in src/java.base/unix/native/libjava/childproc.c

Reviewed-by: djelinski, rriggs
This commit is contained in:
Jiangli Zhou 2024-02-27 16:43:37 +00:00
parent 4fcae1aef5
commit 81b065a95d
2 changed files with 7 additions and 20 deletions

View File

@ -36,7 +36,7 @@
const char * const *parentPathv; const char * const *parentPathv;
int static int
restartableDup2(int fd_from, int fd_to) restartableDup2(int fd_from, int fd_to)
{ {
int err; int err;
@ -50,7 +50,7 @@ closeSafely(int fd)
return (fd == -1) ? 0 : close(fd); return (fd == -1) ? 0 : close(fd);
} }
int static int
isAsciiDigit(char c) isAsciiDigit(char c)
{ {
return c >= '0' && c <= '9'; return c >= '0' && c <= '9';
@ -65,7 +65,7 @@ isAsciiDigit(char c)
#define FD_DIR "/proc/self/fd" #define FD_DIR "/proc/self/fd"
#endif #endif
int static int
closeDescriptors(void) closeDescriptors(void)
{ {
DIR *dp; DIR *dp;
@ -103,7 +103,7 @@ closeDescriptors(void)
return 1; return 1;
} }
int static int
moveDescriptor(int fd_from, int fd_to) moveDescriptor(int fd_from, int fd_to)
{ {
if (fd_from != 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 * misfeature, but compatibility wins over sanity. The original support for
* this was imported accidentally from execvp(). * this was imported accidentally from execvp().
*/ */
void static void
execve_as_traditional_shell_script(const char *file, execve_as_traditional_shell_script(const char *file,
const char *argv[], const char *argv[],
const char *const envp[]) 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 * 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. * 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, execve_with_shell_fallback(int mode, const char *file,
const char *argv[], const char *argv[],
const char *const envp[]) 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 * JDK_execvpe is identical to execvp, except that the child environment is
* specified via the 3rd argument instead of being inherited from environ. * specified via the 3rd argument instead of being inherited from environ.
*/ */
void static void
JDK_execvpe(int mode, const char *file, JDK_execvpe(int mode, const char *file,
const char *argv[], const char *argv[],
const char *const envp[]) const char *const envp[])

View File

@ -128,24 +128,11 @@ typedef struct _SpawnInfo {
extern const char * const *parentPathv; extern const char * const *parentPathv;
ssize_t writeFully(int fd, const void *buf, size_t count); ssize_t writeFully(int fd, const void *buf, size_t count);
int restartableDup2(int fd_from, int fd_to);
int closeSafely(int fd); int closeSafely(int fd);
int isAsciiDigit(char c);
int closeDescriptors(void);
int moveDescriptor(int fd_from, int fd_to);
int magicNumber(); int magicNumber();
ssize_t readFully(int fd, void *buf, size_t nbyte); ssize_t readFully(int fd, void *buf, size_t nbyte);
void initVectorFromBlock(const char**vector, const char* block, int count); 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); int childProcess(void *arg);
#ifdef DEBUG #ifdef DEBUG