]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/dpkgpm.cc
fix -Wall errors
[apt.git] / apt-pkg / deb / dpkgpm.cc
index d8fc8ef68cce46689114165819e9d6466f9e0f96..34ae4e593252fd486c0b6859fe6c57605b889f50 100644 (file)
@@ -134,6 +134,8 @@ static void dpkgChrootDirectory()
    std::cerr << "Chrooting into " << chrootDir << std::endl;
    if (chroot(chrootDir.c_str()) != 0)
       _exit(100);
+   if (chdir("/") != 0)
+      _exit(100);
 }
                                                                        /*}}}*/
 
@@ -754,7 +756,8 @@ bool pkgDPkgPM::OpenLog()
       pw = getpwnam("root");
       gr = getgrnam("adm");
       if (pw != NULL && gr != NULL)
-         chown(logfile_name.c_str(), pw->pw_uid, gr->gr_gid);
+         if(chown(logfile_name.c_str(), pw->pw_uid, gr->gr_gid) != 0)
+            _error->Errno("OpenLog", "chown failed");
       chmod(logfile_name.c_str(), 0640);
       fprintf(d->term_out, "\nLog started: %s\n", timestr);
    }