Sfoglia il codice sorgente

s-s-d: Rename pidexec to process_name in KVM's pid_is_cmd()

Guillem Jover 14 anni fa
parent
commit
c71aa96d10
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 4 4
      utils/start-stop-daemon.c

+ 4 - 4
utils/start-stop-daemon.c

@@ -1188,7 +1188,7 @@ pid_is_cmd(pid_t pid, const char *name)
 	kvm_t *kd;
 	kvm_t *kd;
 	int nentries;
 	int nentries;
 	struct kinfo_proc *kp;
 	struct kinfo_proc *kp;
-	char errbuf[_POSIX2_LINE_MAX], *pidexec;
+	char errbuf[_POSIX2_LINE_MAX], *process_name;
 
 
 	kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf);
 	kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf);
 	if (kd == NULL)
 	if (kd == NULL)
@@ -1196,10 +1196,10 @@ pid_is_cmd(pid_t pid, const char *name)
 	kp = kvm_getprocs(kd, KERN_PROC_PID, pid, &nentries);
 	kp = kvm_getprocs(kd, KERN_PROC_PID, pid, &nentries);
 	if (kp == NULL)
 	if (kp == NULL)
 		errx(1, "%s", kvm_geterr(kd));
 		errx(1, "%s", kvm_geterr(kd));
-	pidexec = (&kp->kp_proc)->p_comm;
-	if (strlen(name) != strlen(pidexec))
+	process_name = (&kp->kp_proc)->p_comm;
+	if (strlen(name) != strlen(process_name))
 		return false;
 		return false;
-	return (strcmp(name, pidexec) == 0) ? 1 : 0;
+	return (strcmp(name, process_name) == 0) ? 1 : 0;
 }
 }
 #endif
 #endif