summaryrefslogtreecommitdiffstats
path: root/src/Hooks
diff options
context:
space:
mode:
authorZdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com>2009-04-28 17:08:09 +0200
committerZdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com>2009-04-28 17:08:09 +0200
commit2e6a6e8aed825e456600d01c8a805b6f6fd24c3a (patch)
treec58cba2913350fed9674813b3fe0a27e6639fbd2 /src/Hooks
parentb08d5c2cf630ecb89d2f22b985dcdfcf25494258 (diff)
new commlayerinner interface
Diffstat (limited to 'src/Hooks')
-rw-r--r--src/Hooks/CCpp.cpp13
-rw-r--r--src/Hooks/Makefile.am2
2 files changed, 8 insertions, 7 deletions
diff --git a/src/Hooks/CCpp.cpp b/src/Hooks/CCpp.cpp
index 646beaf..05e0b56 100644
--- a/src/Hooks/CCpp.cpp
+++ b/src/Hooks/CCpp.cpp
@@ -20,6 +20,7 @@
*/
#include "DebugDump.h"
+#include "ABRTException.h"
#include <stdlib.h>
#include <string.h>
#include <limits.h>
@@ -132,7 +133,7 @@ int main(int argc, char** argv)
{
free(executable);
free(cmdline);
- throw std::string("Can not get proc info.");
+ throw CABRTException(EXCEP_FATAL, "Can not get proc info.");
}
snprintf(path, sizeof(path), "%s/ccpp-%ld-%s", dddir, time(NULL), pid);
@@ -148,7 +149,7 @@ int main(int argc, char** argv)
{
dd.Delete();
dd.Close();
- throw std::string("Can not open the file ") + path;
+ throw CABRTException(EXCEP_FATAL, std::string("Can not open the file ") + path);
}
// TODO: rewrite this
while ((byte = getc(stdin)) != EOF)
@@ -158,7 +159,7 @@ int main(int argc, char** argv)
fclose(fp);
dd.Delete();
dd.Close();
- throw std::string("Can not write to the file %s.");
+ throw CABRTException(EXCEP_FATAL, "Can not write to the file %s.");
}
}
@@ -168,10 +169,10 @@ int main(int argc, char** argv)
dd.Close();
write_success_log(pid);
}
- catch (std::string sError)
+ catch (std::exception& e)
{
- fprintf(stderr, "%s: %s\n", program_name, sError.c_str());
- write_faliure_log(sError.c_str());
+ fprintf(stderr, "%s: %s\n", program_name, e.what());
+ write_faliure_log(e.what());
return -2;
}
return 0;
diff --git a/src/Hooks/Makefile.am b/src/Hooks/Makefile.am
index 48d34e8..88361c6 100644
--- a/src/Hooks/Makefile.am
+++ b/src/Hooks/Makefile.am
@@ -3,5 +3,5 @@ libexec_PROGRAMS = hookCCpp
# CCpp
hookCCpp_SOURCES = CCpp.cpp
hookCCpp_LDADD = ../../lib/Utils/libABRTUtils.la
-hookCCpp_CPPFLAGS = -I$(srcdir)/../../lib/Utils \
+hookCCpp_CPPFLAGS = -I$(srcdir)/../../inc -I$(srcdir)/../../lib/Utils \
-DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\"