summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cmdline/cmdline_changelog.cc3
-rw-r--r--src/generic/apt/download_install_manager.cc2
-rw-r--r--src/pkg_item.cc4
-rw-r--r--src/pkg_ver_item.cc7
-rw-r--r--src/ui.cc15
5 files changed, 19 insertions, 12 deletions
diff --git a/src/cmdline/cmdline_changelog.cc b/src/cmdline/cmdline_changelog.cc
index 53e6faf7..3dd70362 100644
--- a/src/cmdline/cmdline_changelog.cc
+++ b/src/cmdline/cmdline_changelog.cc
@@ -425,7 +425,8 @@ void do_cmdline_changelog(const vector<string> &packages,
_error->Error(_("Couldn't find a changelog for %s"), input.c_str());
else
// Run the user's pager.
- system((string(pager) + " " + filename.get_name()).c_str());
+ if(system((string(pager) + " " + filename.get_name()).c_str()) != 0)
+ _error->Error(_("Couldn't run pager %s"), pager);
}
_error->DumpErrors();
diff --git a/src/generic/apt/download_install_manager.cc b/src/generic/apt/download_install_manager.cc
index 9ba5e47e..e3ab4c37 100644
--- a/src/generic/apt/download_install_manager.cc
+++ b/src/generic/apt/download_install_manager.cc
@@ -166,7 +166,7 @@ pkgPackageManager::OrderResult download_install_manager::run_dpkg(int status_fd)
case pkgPackageManager::Failed:
_error->DumpErrors();
cerr << _("A package failed to install. Trying to recover:") << endl;
- system("DPKG_NO_TSTP=1 dpkg --configure -a");
+ if(system("DPKG_NO_TSTP=1 dpkg --configure -a") != 0) { /* ignore */ }
break;
case pkgPackageManager::Completed:
break;
diff --git a/src/pkg_item.cc b/src/pkg_item.cc
index 5bbacd1f..eb28686a 100644
--- a/src/pkg_item.cc
+++ b/src/pkg_item.cc
@@ -371,7 +371,7 @@ bool pkg_item::dispatch_key(const cw::config::key &k, cw::tree *owner)
printf(_("Reporting a bug in %s:\n"), package.Name());
- system(cmd.c_str());
+ if(system(cmd.c_str()) != 0) { /* ignore */ }
cw::toplevel::resume();
}
@@ -405,7 +405,7 @@ bool pkg_item::dispatch_key(const cw::config::key &k, cw::tree *owner)
snprintf(buf, 512, sucmd,
package.FullName(true).c_str());
- system(buf);
+ if(system(buf) != 0) { /* FIXME: ignore? */ }
cerr<<_("Press return to continue.\n");
getchar();
diff --git a/src/pkg_ver_item.cc b/src/pkg_ver_item.cc
index ba12b469..08d1b8c8 100644
--- a/src/pkg_ver_item.cc
+++ b/src/pkg_ver_item.cc
@@ -747,15 +747,10 @@ bool pkg_ver_item::dispatch_key(const cw::config::key &k, cw::tree *owner)
printf(_("Reporting a bug in %s:\n"), version.ParentPkg().Name());
-
-
-
- system(cmd.c_str());
+ if(system(cmd.c_str()) != 0) { /* ignore */ }
sigaction(SIGCONT, &oldact, NULL);
-
-
cw::toplevel::resume();
progress_ref p = gen_progress_bar();
diff --git a/src/ui.cc b/src/ui.cc
index 4d7921b8..83dfd7b5 100644
--- a/src/ui.cc
+++ b/src/ui.cc
@@ -480,7 +480,12 @@ static void do_su_to_root(string args)
// Read one byte from the FIFO for synchronization
char tmp;
int fd = open(fifoname.get_name().c_str(), O_RDONLY);
- read(fd, &tmp, 1); // Will block until the other process writes.
+ if(read(fd, &tmp, 1) < 0)
+ {
+ std::string errmsg = ssprintf("aptitude: failed to synchronize with parent process");
+ perror(errmsg.c_str());
+ exit(1);
+ }
close(fd);
// It's ok to use argv0 to generate the command,
@@ -555,7 +560,13 @@ static void do_su_to_root(string args)
// Ok, wake the other process up.
char tmp=0;
int fd=open(fifoname.get_name().c_str(), O_WRONLY);
- write(fd, &tmp, 1);
+ if(write(fd, &tmp, 1) < 0)
+ {
+ // If we can't synchronize with it, we'd better kill it.
+ std::string errmsg = ssprintf("aptitude: failed to synchronize with child process");
+ perror(errmsg.c_str());
+ kill(pid, SIGTERM);
+ }
close(fd);
// Wait for a while so we don't accidentally daemonize ourselves.