Просмотр исходного кода

Use dead_pid instead of r as variable name for waitpid() return value

Guillem Jover лет назад: 12
Родитель
Сommit
d6341c151b
2 измененных файлов с 6 добавлено и 6 удалено
  1. 3 3
      lib/dpkg/subproc.c
  2. 3 3
      utils/update-alternatives.c

+ 3 - 3
lib/dpkg/subproc.c

@@ -141,12 +141,12 @@ subproc_check(int status, const char *desc, int flags)
 int
 int
 subproc_wait(pid_t pid, const char *desc)
 subproc_wait(pid_t pid, const char *desc)
 {
 {
-	pid_t r;
+	pid_t dead_pid;
 	int status;
 	int status;
 
 
-	while ((r = waitpid(pid, &status, 0)) == -1 && errno == EINTR) ;
+	while ((dead_pid = waitpid(pid, &status, 0)) == -1 && errno == EINTR) ;
 
 
-	if (r != pid) {
+	if (dead_pid != pid) {
 		onerr_abort++;
 		onerr_abort++;
 		ohshite(_("wait for subprocess %s failed"), desc);
 		ohshite(_("wait for subprocess %s failed"), desc);
 	}
 	}

+ 3 - 3
utils/update-alternatives.c

@@ -403,7 +403,7 @@ log_msg(const char *fmt, ...)
 static int
 static int
 spawn(const char *prog, const char *args[])
 spawn(const char *prog, const char *args[])
 {
 {
-	pid_t pid, r;
+	pid_t pid, dead_pid;
 	int status;
 	int status;
 
 
 	pid = fork();
 	pid = fork();
@@ -413,8 +413,8 @@ spawn(const char *prog, const char *args[])
 		execvp(prog, (char *const *)args);
 		execvp(prog, (char *const *)args);
 		syserr(_("unable to execute %s (%s)"), prog, prog);
 		syserr(_("unable to execute %s (%s)"), prog, prog);
 	}
 	}
-	while ((r = waitpid(pid, &status, 0)) == -1 && errno == EINTR) ;
-	if (r != pid)
+	while ((dead_pid = waitpid(pid, &status, 0)) == -1 && errno == EINTR) ;
+	if (dead_pid != pid)
 		error(_("wait for subprocess %s failed"), prog);
 		error(_("wait for subprocess %s failed"), prog);
 
 
 	return status;
 	return status;