]> git.saurik.com Git - apt.git/commitdiff
fix -Wall errors
authorMichael Vogt <mvo@debian.org>
Thu, 8 Aug 2013 13:40:15 +0000 (15:40 +0200)
committerMichael Vogt <mvo@debian.org>
Thu, 8 Aug 2013 13:40:15 +0000 (15:40 +0200)
apt-pkg/deb/dpkgpm.cc
apt-pkg/tagfile.h
apt-pkg/vendorlist.cc
cmdline/apt-cdrom.cc
ftparchive/writer.cc

index b0bd6b18477f9bcac408262ebc395909b39cd996..34ae4e593252fd486c0b6859fe6c57605b889f50 100644 (file)
@@ -134,7 +134,8 @@ static void dpkgChrootDirectory()
    std::cerr << "Chrooting into " << chrootDir << std::endl;
    if (chroot(chrootDir.c_str()) != 0)
       _exit(100);
-   chdir("/");
+   if (chdir("/") != 0)
+      _exit(100);
 }
                                                                        /*}}}*/
 
@@ -755,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);
    }
index 126f4219de805bba3c40243146df55b0e4c13c57..fedd72701528856cc930e5a8035fd22ae1895cf7 100644 (file)
@@ -84,7 +84,7 @@ class pkgTagSection
       Stop = this->Stop;
    };
    
-   pkgTagSection() : Section(0), TagCount(0), Stop(0), d(NULL) {};
+   pkgTagSection() : Section(0), TagCount(0), d(NULL), Stop(0) {};
    virtual ~pkgTagSection() {};
 };
 
index ecfc7db878aa46c291933714d0103a15e494574c..6024256241eef05fc041e85c4a15a1e0359e79a8 100644 (file)
@@ -66,7 +66,7 @@ bool pkgVendorList::CreateList(Configuration& Cnf)                    /*{{{*/
       Configuration Block(Top);
       string VendorID = Top->Tag;
       vector <struct Vendor::Fingerprint *> *Fingerprints = new vector<Vendor::Fingerprint *>;
-      struct Vendor::Fingerprint *Fingerprint = new struct Vendor::Fingerprint;
+      struct Vendor::Fingerprint *Fingerprint = new struct Vendor::Fingerprint();
       string Origin = Block.Find("Origin");
 
       Fingerprint->Print = Block.Find("Fingerprint");
index c153cca85f514774a027b20a3e305f838bc5cbd8..545edf43930a8a884bf2adcf639aea424698caff 100644 (file)
@@ -66,7 +66,8 @@ void pkgCdromTextStatus::Prompt(const char *Text)
 {
    char C;
    cout << Text << ' ' << flush;
-   read(STDIN_FILENO,&C,1);
+   if (read(STDIN_FILENO,&C,1) < 0)
+      _error->Errno("pkgCdromTextStatus::Prompt", "failed to prompt");
    if (C != '\n')
       cout << endl;
 }
index 3283128d81a52ec297dc43f485ceed538b549d98..7ecfe78ede2172c404003ab4dcffac11a9af0a71 100644 (file)
@@ -284,7 +284,8 @@ bool FTWScanner::Delink(string &FileName,const char *OriginalPath,
                  if (link(FileName.c_str(),OriginalPath) != 0)
                  {
                     // Panic! Restore the symlink
-                    symlink(OldLink,OriginalPath);
+                    if (symlink(OldLink,OriginalPath) != 0)
+                        _error->Errno("symlink", "failed to restore symlink");
                     return _error->Errno("link",_("*** Failed to link %s to %s"),
                                          FileName.c_str(),
                                          OriginalPath);