Replaces int types with the appropriate definition in atomic and PID instances. David Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx> --- builtin-apply.c | 2 +- builtin-read-tree.c | 2 +- builtin-tar-tree.c | 4 ++-- connect.c | 4 ++-- fetch-clone.c | 3 +-- merge-index.c | 3 ++- run-command.c | 8 ++++---- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/builtin-apply.c b/builtin-apply.c index be2c715..2862eb1 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -2097,7 +2097,7 @@ static void create_one_file(char *path, } if (errno == EEXIST) { - unsigned int nr = getpid(); + pid_t nr = getpid(); for (;;) { const char *newpath; diff --git a/builtin-read-tree.c b/builtin-read-tree.c index b30160a..f902fee 100644 --- a/builtin-read-tree.c +++ b/builtin-read-tree.c @@ -23,7 +23,7 @@ static int nontrivial_merge = 0; static int trivial_merges_only = 0; static int aggressive = 0; static int verbose_update = 0; -static volatile int progress_update = 0; +static volatile sig_atomic_t progress_update = 0; static const char *prefix = NULL; static int head_idx = -1; diff --git a/builtin-tar-tree.c b/builtin-tar-tree.c index 215892b..6fed919 100644 --- a/builtin-tar-tree.c +++ b/builtin-tar-tree.c @@ -361,8 +361,8 @@ static const char *exec = "git-upload-ta static int remote_tar(int argc, const char **argv) { - int fd[2], ret, len; - pid_t pid; + int fd[2], len; + pid_t pid, ret; char buf[1024]; char *url; diff --git a/connect.c b/connect.c index 4422a0d..a4c02d1 100644 --- a/connect.c +++ b/connect.c @@ -735,9 +735,9 @@ int git_connect(int fd[2], char *url, co return pid; } -int finish_connect(pid_t pid) +pid_t finish_connect(pid_t pid) { - int ret; + pid_t ret; for (;;) { ret = waitpid(pid, NULL, 0); diff --git a/fetch-clone.c b/fetch-clone.c index 5e84c46..c5cf477 100644 --- a/fetch-clone.c +++ b/fetch-clone.c @@ -44,9 +44,8 @@ static int finish_pack(const char *pack_ for (;;) { int status, code; - int retval = waitpid(pid, &status, 0); - if (retval < 0) { + if (waitpid(pid, &status, 0) < 0) { if (errno == EINTR) continue; error("waitpid failed (%s)", strerror(errno)); diff --git a/merge-index.c b/merge-index.c index 0498a6f..a9c8cc1 100644 --- a/merge-index.c +++ b/merge-index.c @@ -11,7 +11,8 @@ static int err; static void run_program(void) { - int pid = fork(), status; + pid_t pid = fork(); + int status; if (pid < 0) die("unable to fork"); diff --git a/run-command.c b/run-command.c index ca67ee9..3bacc1b 100644 --- a/run-command.c +++ b/run-command.c @@ -25,15 +25,15 @@ int run_command_v_opt(int argc, const ch } for (;;) { int status, code; - int retval = waitpid(pid, &status, 0); + pid_t waiting = waitpid(pid, &status, 0); - if (retval < 0) { + if (waiting < 0) { if (errno == EINTR) continue; - error("waitpid failed (%s)", strerror(retval)); + error("waitpid failed (%s)", strerror(waiting)); return -ERR_RUN_COMMAND_WAITPID; } - if (retval != pid) + if (waiting != pid) return -ERR_RUN_COMMAND_WAITPID_WRONG_PID; if (WIFSIGNALED(status)) return -ERR_RUN_COMMAND_WAITPID_SIGNAL; -- 1.4.2.GIT - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html