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;
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[])

View File

@ -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