The following commit has been merged in the master branch:
commit f5c904d58627ec1422173a596f2a2ef8584485c2
Author: Guillem Jover <[email protected]>
Date: Fri Nov 6 23:03:01 2009 +0100
libdpkg: Rename and namespace subproc related functions
diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
index c44f0bf..4894d74 100644
--- a/dpkg-deb/build.c
+++ b/dpkg-deb/build.c
@@ -437,8 +437,8 @@ void do_build(const char *const *argv) {
compress_cat(compress_type_gzip, 0, 1, "9", _("control"));
}
close(p1[0]);
- waitsubproc(c2,"gzip -9c",0);
- waitsubproc(c1,"tar -cf",0);
+ subproc_wait_check(c2, "gzip -9c", 0);
+ subproc_wait_check(c1, "tar -cf", 0);
if (fstat(gzfd,&controlstab)) ohshite(_("failed to fstat tmpfile
(control)"));
/* We have our first file for the ar-archive. Write a header for it to the
* package and insert it.
@@ -523,7 +523,7 @@ void do_build(const char *const *argv) {
ohshite(_("failed to write filename to tar pipe (data)"));
}
close(p3[0]);
- waitsubproc(c3,"find",0);
+ subproc_wait_check(c3, "find", 0);
for (fi= symlist;fi;fi= fi->next)
if (write(p1[1], fi->fn, strlen(fi->fn)+1) == -1)
@@ -531,8 +531,8 @@ void do_build(const char *const *argv) {
/* All done, clean up wait for tar and gzip to finish their job */
close(p1[1]);
free_filist(symlist);
- waitsubproc(c2, _("<compress> from tar -cf"), 0);
- waitsubproc(c1,"tar -cf",0);
+ subproc_wait_check(c2, _("<compress> from tar -cf"), 0);
+ subproc_wait_check(c1, "tar -cf", 0);
/* Okay, we have data.tar.gz as well now, add it to the ar wrapper */
if (!oldformatflag) {
const char *datamember;
diff --git a/dpkg-deb/extract.c b/dpkg-deb/extract.c
index 092231f..f0935d5 100644
--- a/dpkg-deb/extract.c
+++ b/dpkg-deb/extract.c
@@ -58,7 +58,7 @@ static void movecontrolfiles(const char *thing) {
execlp("sh", "sh", "-c", buf, NULL);
ohshite(_("failed to exec sh -c mv foo/* &c"));
}
- waitsubproc(c1,"sh -c mv foo/* &c",0);
+ subproc_wait_check(c1, "sh -c mv foo/* &c", 0);
}
static void readfail(FILE *a, const char *filename, const char *what)
DPKG_ATTR_NORET;
@@ -325,12 +325,12 @@ void extracthalf(const char *debar, const char *directory,
ohshite(_("failed to exec tar"));
}
close(p2[0]);
- waitsubproc(c3,"tar",0);
+ subproc_wait_check(c3, "tar", 0);
}
- waitsubproc(c2, _("<decompress>"), PROCPIPE);
+ subproc_wait_check(c2, _("<decompress>"), PROCPIPE);
if (c1 != -1)
- waitsubproc(c1, _("paste"), 0);
+ subproc_wait_check(c1, _("paste"), 0);
if (oldformat && admininfo) {
if (versionnum == 0.931F) {
movecontrolfiles(OLDOLDDEBDIR);
diff --git a/dpkg-deb/info.c b/dpkg-deb/info.c
index a1b5931..695ba4d 100644
--- a/dpkg-deb/info.c
+++ b/dpkg-deb/info.c
@@ -82,7 +82,7 @@ static void info_prepare(const char *const **argvp,
execlp(RM, "rm", "-rf", dbuf, NULL);
ohshite(_("failed to exec rm -rf"));
}
- waitsubproc(c1,"rm -rf",0);
+ subproc_wait_check(c1, "rm -rf", 0);
push_cleanup(cu_info_prepare, -1, NULL, 0, 1, (void *)dbuf);
extracthalf(*debarp, dbuf, "mx", admininfo);
}
diff --git a/dselect/method.cc b/dselect/method.cc
index 7674732..4f1c8b1 100644
--- a/dselect/method.cc
+++ b/dselect/method.cc
@@ -143,10 +143,10 @@ urqresult falliblesubprocess(const char *exepath, const
char *name,
cursesoff();
- setup_subproc_signals(name);
+ subproc_signals_setup(name);
if (!(c1= m_fork())) {
- cu_subproc_signals(0, 0);
+ subproc_signals_cleanup(0, 0);
execvp(exepath,(char* const*) args);
ohshite(_("unable to run %.250s process `%.250s'"),name,exepath);
}
diff --git a/lib/dpkg/subproc.c b/lib/dpkg/subproc.c
index 5a42bf8..faa460c 100644
--- a/lib/dpkg/subproc.c
+++ b/lib/dpkg/subproc.c
@@ -38,7 +38,7 @@ static int catch_signals[] = { SIGQUIT, SIGINT };
static struct sigaction uncatch_signals[sizeof_array(catch_signals)];
void
-setup_subproc_signals(const char *name)
+subproc_signals_setup(const char *name)
{
size_t i;
struct sigaction catchsig;
@@ -52,12 +52,12 @@ setup_subproc_signals(const char *name)
if (sigaction(catch_signals[i], &catchsig, &uncatch_signals[i]))
ohshite(_("unable to ignore signal %s before running
%.250s"),
strsignal(catch_signals[i]), name);
- push_cleanup(cu_subproc_signals, ~0, NULL, 0, 0);
+ push_cleanup(subproc_signals_cleanup, ~0, NULL, 0, 0);
onerr_abort--;
}
void
-cu_subproc_signals(int argc, void **argv)
+subproc_signals_cleanup(int argc, void **argv)
{
size_t i;
@@ -71,7 +71,7 @@ cu_subproc_signals(int argc, void **argv)
}
int
-checksubprocerr(int status, const char *description, int flags)
+subproc_check(int status, const char *description, int flags)
{
int n;
@@ -110,7 +110,7 @@ checksubprocerr(int status, const char *description, int
flags)
}
int
-waitsubproc(pid_t pid, const char *description, int flags)
+subproc_wait_check(pid_t pid, const char *description, int flags)
{
pid_t r;
int status;
@@ -122,6 +122,6 @@ waitsubproc(pid_t pid, const char *description, int flags)
ohshite(_("wait for %s failed"), description);
}
- return checksubprocerr(status, description, flags);
+ return subproc_check(status, description, flags);
}
diff --git a/lib/dpkg/subproc.h b/lib/dpkg/subproc.h
index 19bfe59..2a51a90 100644
--- a/lib/dpkg/subproc.h
+++ b/lib/dpkg/subproc.h
@@ -28,15 +28,15 @@
DPKG_BEGIN_DECLS
-void setup_subproc_signals(const char *name);
-void cu_subproc_signals(int argc, void **argv);
+void subproc_signals_setup(const char *name);
+void subproc_signals_cleanup(int argc, void **argv);
#define PROCPIPE 1
#define PROCWARN 2
#define PROCNOERR 4
-int checksubprocerr(int status, const char *desc, int flags);
-int waitsubproc(pid_t pid, const char *desc, int flags);
+int subproc_check(int status, const char *desc, int flags);
+int subproc_wait_check(pid_t pid, const char *desc, int flags);
DPKG_END_DECLS
diff --git a/src/archives.c b/src/archives.c
index f8c2d2f..75e9232 100644
--- a/src/archives.c
+++ b/src/archives.c
@@ -1117,7 +1117,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= waitsubproc(fc,"find",PROCNOERR);
+ r = subproc_wait_check(fc, "find", PROCNOERR);
if(!(r==0 || r==1))
ohshit(_("find for --recursive returned unhandled error %i"),r);
diff --git a/src/help.c b/src/help.c
index 3b76455..b53107c 100644
--- a/src/help.c
+++ b/src/help.c
@@ -296,8 +296,8 @@ do_script(struct pkginfo *pkg, struct pkginfoperfile *pif,
execv(scriptexec,(char * const *)narglist);
ohshite(desc,name);
}
- setup_subproc_signals(name); /* This does a push_cleanup() */
- r= waitsubproc(c1,name,warn);
+ subproc_signals_setup(name); /* This does a push_cleanup() */
+ r = subproc_wait_check(c1, name, warn);
pop_cleanup(ehflag_normaltidy);
pop_cleanup(ehflag_normaltidy);
@@ -595,7 +595,7 @@ void ensure_pathname_nonexisting(const char *pathname) {
ohshite(_("failed to exec rm for cleanup"));
}
debug(dbg_eachfile,"ensure_pathname_nonexisting running rm -rf");
- waitsubproc(c1,"rm cleanup",0);
+ subproc_wait_check(c1, "rm cleanup", 0);
}
void log_action(const char *action, struct pkginfo *pkg) {
diff --git a/src/processarc.c b/src/processarc.c
index f29d356..57ad472 100644
--- a/src/processarc.c
+++ b/src/processarc.c
@@ -143,7 +143,7 @@ void process_archive(const char *filename) {
/* No, it wasn't a part. */
break;
default:
- checksubprocerr(status,SPLITTER,0);
+ subproc_check(status, SPLITTER, 0);
}
}
@@ -199,7 +199,7 @@ void process_archive(const char *filename) {
execlp(BACKEND, BACKEND, "--control", filename, cidir, NULL);
ohshite(_("failed to exec dpkg-deb to extract control information"));
}
- waitsubproc(c1,BACKEND " --control",0);
+ subproc_wait_check(c1, BACKEND " --control", 0);
strcpy(cidirrest,CONTROLFILE);
parsedb(cidir, pdb_recordavailable | pdb_rejectstatus | pdb_ignorefiles,
@@ -607,7 +607,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;
- waitsubproc(c1,BACKEND " --fsys-tarfile",PROCPIPE);
+ subproc_wait_check(c1, BACKEND " --fsys-tarfile", PROCPIPE);
if (oldversionstatus == stat_halfinstalled || oldversionstatus ==
stat_unpacked) {
/* Packages that were in `installed' and `postinstfailed' have been reduced
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]