summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-08-09 12:11:03 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-08-09 12:11:03 +0200
commit3bab9d79a01ac70a78c012eaa82dccaaa5c59ee5 (patch)
treeb22cb40eac1cff376d2cb0abb066202fe414eae3 /lib
parent5bfd6ac66529ed1976db7df0ab4853eec855e411 (diff)
downloadabrt-3bab9d79a01ac70a78c012eaa82dccaaa5c59ee5.tar.gz
abrt-3bab9d79a01ac70a78c012eaa82dccaaa5c59ee5.tar.xz
abrt-3bab9d79a01ac70a78c012eaa82dccaaa5c59ee5.zip
fix compile-time warnings.
One fix (in CCrashWatcher::GetPluginsInfo) needs closer look, others are "trivially correct" Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Plugins/Bugzilla.cpp7
-rw-r--r--lib/Plugins/CCpp.cpp12
-rw-r--r--lib/Plugins/KerneloopsReporter.cpp5
-rw-r--r--lib/Utils/xfuncs.cpp6
4 files changed, 17 insertions, 13 deletions
diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp
index 227f269..6bbb75c 100644
--- a/lib/Plugins/Bugzilla.cpp
+++ b/lib/Plugins/Bugzilla.cpp
@@ -8,11 +8,11 @@
#include <string.h>
CReporterBugzilla::CReporterBugzilla() :
- m_sBugzillaURL("https://bugzilla.redhat.com/xmlrpc.cgi"),
- m_bNoSSLVerify(false),
m_pXmlrpcTransport(NULL),
m_pXmlrpcClient(NULL),
- m_pCarriageParm(NULL)
+ m_pCarriageParm(NULL),
+ m_sBugzillaURL("https://bugzilla.redhat.com/xmlrpc.cgi"),
+ m_bNoSSLVerify(false)
{}
CReporterBugzilla::~CReporterBugzilla()
@@ -242,7 +242,6 @@ void CReporterBugzilla::AddAttachments(const std::string& pBugId, const map_cras
map_xmlrpc_params_t attachmentParams;
std::vector<xmlrpc_c::value> ret;
NSSBase64Encoder* base64;
- std::string::size_type pos;
map_crash_report_t::const_iterator it;
for (it = pCrashReport.begin(); it != pCrashReport.end(); it++)
diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp
index 6d092bf..657e372 100644
--- a/lib/Plugins/CCpp.cpp
+++ b/lib/Plugins/CCpp.cpp
@@ -84,11 +84,10 @@ static void InstallDebugInfos(const std::string& pPackage)
std::string packageName = pPackage.substr(0, pPackage.rfind("-", pPackage.rfind("-")-1));
char buff[1024];
int pipein[2], pipeout[2];
- struct timeval delay;
pid_t child;
- pipe(pipein); /* error check? */
- pipe(pipeout);
+ xpipe(pipein);
+ xpipe(pipeout);
child = fork();
if (child < 0)
@@ -128,6 +127,7 @@ static void InstallDebugInfos(const std::string& pPackage)
/* Was before read, does not seem to be needed
fd_set rsfd;
FD_ZERO(&rsfd);
+ struct timeval delay;
FD_SET(pipeout[0], &rsfd);
@@ -221,7 +221,6 @@ static void GetIndependentBacktrace(const std::string& pBacktrace, std::string&
int ii = 0;
std::string line;
std::string header;
- int jj = 0;
bool in_bracket = false;
bool in_quote = false;
bool in_header = false;
@@ -346,9 +345,7 @@ static pid_t ExecVP(const char* pCommand, char* const pArgs[], uid_t uid, std::s
{
int pipeout[2];
char buff[1024];
- struct timeval delay;
pid_t child;
- gid_t GID[1];
struct passwd* pw = getpwuid(uid);
if (!pw)
@@ -356,7 +353,7 @@ static pid_t ExecVP(const char* pCommand, char* const pArgs[], uid_t uid, std::s
throw CABRTException(EXCEP_PLUGIN, std::string(__func__) + ": cannot get GID for UID.");
}
- pipe(pipeout); /* error check? */
+ xpipe(pipeout);
child = fork();
if (child == -1)
{
@@ -399,6 +396,7 @@ static pid_t ExecVP(const char* pCommand, char* const pArgs[], uid_t uid, std::s
fd_set rsfd;
FD_ZERO(&rsfd);
FD_SET(pipeout[0], &rsfd);
+ struct timeval delay;
delay.tv_sec = 1;
delay.tv_usec = 0;
diff --git a/lib/Plugins/KerneloopsReporter.cpp b/lib/Plugins/KerneloopsReporter.cpp
index 64037aa..a839b5b 100644
--- a/lib/Plugins/KerneloopsReporter.cpp
+++ b/lib/Plugins/KerneloopsReporter.cpp
@@ -35,10 +35,11 @@
static size_t writefunction(void *ptr, size_t size, size_t nmemb, void *stream)
{
+ size *= nmemb;
+/*
char *c, *c1, *c2;
- size *= nmemb;
-/* log("received: '%*.*s'\n", (int)size, (int)size, (char*)ptr);
+ log("received: '%*.*s'\n", (int)size, (int)size, (char*)ptr);
c = (char*)xzalloc(size + 1);
memcpy(c, ptr, size);
c1 = strstr(c, "201 ");
diff --git a/lib/Utils/xfuncs.cpp b/lib/Utils/xfuncs.cpp
index 078c804..60c2eb4 100644
--- a/lib/Utils/xfuncs.cpp
+++ b/lib/Utils/xfuncs.cpp
@@ -88,6 +88,12 @@ void xpipe(int filedes[2])
perror_msg_and_die("can't create pipe");
}
+void xdup(int from)
+{
+ if (dup(from) < 0)
+ perror_msg_and_die("can't duplicate file descriptor");
+}
+
void xdup2(int from, int to)
{
if (dup2(from, to) != to)