X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/4d055c05ce287dabd9e224af5c71d690a44b2db6..b39c18596d05cea1b3c0f0445b17080e9a2e4c19:/apt-pkg/contrib/error.cc diff --git a/apt-pkg/contrib/error.cc b/apt-pkg/contrib/error.cc index 6aa740d29..927b7e05c 100644 --- a/apt-pkg/contrib/error.cc +++ b/apt-pkg/contrib/error.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: error.cc,v 1.10 2001/05/07 05:28:44 jgg Exp $ +// $Id: error.cc,v 1.11 2002/03/26 07:38:58 jgg Exp $ /* ###################################################################### Global Erorr Class - Global error mechanism @@ -14,19 +14,17 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#ifdef __GNUG__ -#pragma implementation "apt-pkg/error.h" -#endif - #include -#include +#include #include #include -#include #include #include +#include +#include + #include "config.h" /*}}}*/ @@ -86,17 +84,17 @@ bool GlobalError::Errno(const char *Function,const char *Description,...) char S[400]; vsnprintf(S,sizeof(S),Description,args); snprintf(S + strlen(S),sizeof(S) - strlen(S), - " - %s (%i %s)",Function,errno,strerror(errno)); + " - %s (%i: %s)",Function,errno,strerror(errno)); // Put it on the list Item *Itm = new Item; Itm->Text = S; Itm->Error = true; Insert(Itm); - + PendingFlag = true; - return false; + return false; } /*}}}*/ // GlobalError::WarningE - Get part of the warn string from errno /*{{{*/ @@ -114,15 +112,16 @@ bool GlobalError::WarningE(const char *Function,const char *Description,...) // sprintf the description char S[400]; vsnprintf(S,sizeof(S),Description,args); - snprintf(S + strlen(S),sizeof(S) - strlen(S)," - %s (%i %s)",Function,errno,strerror(errno)); + snprintf(S + strlen(S),sizeof(S) - strlen(S), + " - %s (%i: %s)",Function,errno,strerror(errno)); // Put it on the list Item *Itm = new Item; Itm->Text = S; Itm->Error = false; Insert(Itm); - - return false; + + return false; } /*}}}*/ // GlobalError::Error - Add an error to the list /*{{{*/