|
|
@@ -54,9 +54,11 @@ bool pkgArchiveCleaner::Go(std::string Dir,pkgCache &Cache)
|
|
|
struct stat St;
|
|
|
if (stat(Dir->d_name,&St) != 0)
|
|
|
{
|
|
|
- chdir(StartDir.c_str());
|
|
|
+ _error->Errno("stat",_("Unable to stat %s."),Dir->d_name);
|
|
|
closedir(D);
|
|
|
- return _error->Errno("stat",_("Unable to stat %s."),Dir->d_name);
|
|
|
+ if (chdir(StartDir.c_str()) != 0)
|
|
|
+ return _error->Errno("chdir", _("Unable to change to %s"), StartDir.c_str());
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
// Grab the package name
|
|
|
@@ -115,8 +117,9 @@ bool pkgArchiveCleaner::Go(std::string Dir,pkgCache &Cache)
|
|
|
Erase(Dir->d_name,Pkg,Ver,St);
|
|
|
};
|
|
|
|
|
|
- chdir(StartDir.c_str());
|
|
|
closedir(D);
|
|
|
- return true;
|
|
|
+ if (chdir(StartDir.c_str()) != 0)
|
|
|
+ return _error->Errno("chdir", _("Unable to change to %s"), StartDir.c_str());
|
|
|
+ return true;
|
|
|
}
|
|
|
/*}}}*/
|