The following commit has been merged in the master branch:
commit 44e022a801e0b5720a6e8d6887788ebf15b9995f
Author: Guillem Jover <[email protected]>
Date: Thu Jan 20 18:41:09 2011 +0100
Use pid instead of c1 for variable name
diff --git a/dpkg-deb/extract.c b/dpkg-deb/extract.c
index 28564df..fef408b 100644
--- a/dpkg-deb/extract.c
+++ b/dpkg-deb/extract.c
@@ -52,14 +52,14 @@
static void movecontrolfiles(const char *thing) {
char buf[200];
- pid_t c1;
+ pid_t pid;
sprintf(buf, "mv %s/* . && rmdir %s", thing, thing);
- c1 = subproc_fork();
- if (!c1) {
+ pid = subproc_fork();
+ if (pid == 0) {
command_shell(buf, _("shell command to move files"));
}
- subproc_wait_check(c1, _("shell command to move files"), 0);
+ subproc_wait_check(pid, _("shell command to move files"), 0);
}
static void DPKG_ATTR_NORET
diff --git a/dpkg-deb/info.c b/dpkg-deb/info.c
index ab49fbf..999fb9a 100644
--- a/dpkg-deb/info.c
+++ b/dpkg-deb/info.c
@@ -48,7 +48,7 @@
#include "dpkg-deb.h"
static void cu_info_prepare(int argc, void **argv) {
- pid_t c1;
+ pid_t pid;
char *dir;
struct stat stab;
@@ -58,12 +58,12 @@ static void cu_info_prepare(int argc, void **argv) {
if (lstat(dir, &stab) && errno == ENOENT)
return;
- c1 = subproc_fork();
- if (!c1) {
+ pid = subproc_fork();
+ if (pid == 0) {
execlp(RM, "rm", "-rf", dir, NULL);
ohshite(_("unable to execute %s (%s)"), _("rm command for cleanup"), RM);
}
- subproc_wait_check(c1, _("rm command for cleanup"), 0);
+ subproc_wait_check(pid, _("rm command for cleanup"), 0);
}
static void info_prepare(const char *const **argvp,
diff --git a/dselect/method.cc b/dselect/method.cc
index b7cd441..4d02890 100644
--- a/dselect/method.cc
+++ b/dselect/method.cc
@@ -139,20 +139,20 @@ static enum urqresult lockmethod(void) {
static urqresult
falliblesubprocess(struct command *cmd)
{
- pid_t c1;
+ pid_t pid;
int status, i, c;
cursesoff();
subproc_signals_setup(cmd->name);
- c1 = subproc_fork();
- if (!c1) {
+ pid = subproc_fork();
+ if (pid == 0) {
subproc_signals_cleanup(0, 0);
command_exec(cmd);
}
- status = subproc_wait(c1, cmd->name);
+ status = subproc_wait(pid, cmd->name);
pop_cleanup(ehflag_normaltidy);
diff --git a/src/archives.c b/src/archives.c
index a3fbf81..1636174 100644
--- a/src/archives.c
+++ b/src/archives.c
@@ -1187,7 +1187,8 @@ void archivefiles(const char *const *argv) {
const char *volatile thisarg;
const char *const *volatile argp;
jmp_buf ejbuf;
- int pi[2], fc, nfiles, c, i, r;
+ int pi[2], nfiles, c, i, r;
+ pid_t pid;
FILE *pf;
static struct varbuf findoutput;
const char **arglist;
@@ -1209,8 +1210,8 @@ void archivefiles(const char *const *argv) {
badusage(_("--%s --recursive needs at least one path
argument"),cipaction->olong);
m_pipe(pi);
- fc = subproc_fork();
- if (!fc) {
+ pid = subproc_fork();
+ if (pid == 0) {
struct command cmd;
const char *const *ap;
@@ -1245,7 +1246,7 @@ void archivefiles(const char *const *argv) {
}
if (ferror(pf)) ohshite(_("error reading find's pipe"));
if (fclose(pf)) ohshite(_("error closing find's pipe"));
- r = subproc_wait_check(fc, "find", PROCNOERR);
+ r = subproc_wait_check(pid, "find", PROCNOERR);
if (r != 0)
ohshit(_("find for --recursive returned unhandled error %i"),r);
diff --git a/src/help.c b/src/help.c
index d46b187..6d8f7b9 100644
--- a/src/help.c
+++ b/src/help.c
@@ -255,14 +255,15 @@ static int
do_script(struct pkginfo *pkg, struct pkgbin *pif,
struct command *cmd, struct stat *stab, int warn)
{
- int c1, r;
+ pid_t pid;
+ int r;
setexecute(cmd->filename, stab);
push_cleanup(cu_post_script_tasks, ehflag_bombout, NULL, 0, 0);
- c1 = subproc_fork();
- if (!c1) {
+ pid = subproc_fork();
+ if (pid == 0) {
if (setenv("DPKG_MAINTSCRIPT_PACKAGE", pkg->name, 1) ||
setenv("DPKG_MAINTSCRIPT_ARCH", pif->architecture, 1) ||
setenv("DPKG_MAINTSCRIPT_NAME", cmd->argv[0], 1) ||
@@ -273,7 +274,7 @@ do_script(struct pkginfo *pkg, struct pkgbin *pif,
command_exec(cmd);
}
subproc_signals_setup(cmd->name); /* This does a push_cleanup(). */
- r = subproc_wait_check(c1, cmd->name, warn);
+ r = subproc_wait_check(pid, cmd->name, warn);
pop_cleanup(ehflag_normaltidy);
pop_cleanup(ehflag_normaltidy);
@@ -566,7 +567,7 @@ secure_unlink_statted(const char *pathname, const struct
stat *stab)
}
void ensure_pathname_nonexisting(const char *pathname) {
- int c1;
+ pid_t pid;
const char *u;
u = path_skip_slash_dotslash(pathname);
@@ -586,13 +587,13 @@ void ensure_pathname_nonexisting(const char *pathname) {
if (errno != ENOTEMPTY && errno != EEXIST) { /* Huh? */
ohshite(_("unable to securely remove '%.255s'"), pathname);
}
- c1 = subproc_fork();
- if (!c1) {
+ pid = subproc_fork();
+ if (pid == 0) {
execlp(RM, "rm", "-rf", "--", pathname, NULL);
ohshite(_("unable to execute %s (%s)"), _("rm command for cleanup"), RM);
}
debug(dbg_eachfile,"ensure_pathname_nonexisting running rm -rf");
- subproc_wait_check(c1, "rm cleanup", 0);
+ subproc_wait_check(pid, "rm cleanup", 0);
}
void log_action(const char *action, struct pkginfo *pkg) {
diff --git a/src/processarc.c b/src/processarc.c
index eee63a3..b686bc0 100644
--- a/src/processarc.c
+++ b/src/processarc.c
@@ -178,7 +178,8 @@ void process_archive(const char *filename) {
static struct varbuf infofnvb, fnvb, depprobwhy;
static struct tarcontext tc;
- int c1, r, admindirlen, i, infodirlen, infodirbaseused;
+ int r, admindirlen, i, infodirlen, infodirbaseused;
+ pid_t pid;
struct pkgiterator *it;
struct pkginfo *pkg, *otherpkg, *divpkg;
char *cidir, *cidirrest, *p;
@@ -244,14 +245,14 @@ void process_archive(const char *filename) {
}
push_cleanup(cu_cidir, ~0, NULL, 0, 2, (void *)cidir, (void *)cidirrest);
- c1 = subproc_fork();
- if (!c1) {
+ pid = subproc_fork();
+ if (pid == 0) {
cidirrest[-1] = '\0';
execlp(BACKEND, BACKEND, "--control", filename, cidir, NULL);
ohshite(_("unable to execute %s (%s)"),
_("package control information extraction"), BACKEND);
}
- subproc_wait_check(c1, BACKEND " --control", 0);
+ subproc_wait_check(pid, BACKEND " --control", 0);
/* We want to guarantee the extracted files are on the disk, so that the
* subsequent renames to the info database do not end up with old or zero
@@ -641,8 +642,8 @@ void process_archive(const char *filename) {
m_pipe(p1);
push_cleanup(cu_closepipe, ehflag_bombout, NULL, 0, 1, (void *)&p1[0]);
- c1 = subproc_fork();
- if (!c1) {
+ pid = subproc_fork();
+ if (pid == 0) {
m_dup2(p1[1],1); close(p1[0]); close(p1[1]);
execlp(BACKEND, BACKEND, "--fsys-tarfile", filename, NULL);
ohshite(_("unable to execute %s (%s)"),
@@ -668,7 +669,7 @@ void process_archive(const char *filename) {
fd_null_copy(p1[0], -1, _("dpkg-deb: zap possible trailing zeros"));
close(p1[0]);
p1[0] = -1;
- subproc_wait_check(c1, BACKEND " --fsys-tarfile", PROCPIPE);
+ subproc_wait_check(pid, BACKEND " --fsys-tarfile", PROCPIPE);
tar_deferred_extract(newfileslist, pkg);
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]