* [Cluster-devel] conga/ricci/ricci DBusController.cpp DBusContr ...
@ 2006-07-25 19:30 kupcevic
0 siblings, 0 replies; only message in thread
From: kupcevic @ 2006-07-25 19:30 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Changes by: kupcevic at sourceware.org 2006-07-25 19:30:15
Modified files:
ricci/ricci : DBusController.cpp DBusController.h
Log message:
D-BUS API changed
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/ricci/DBusController.cpp.diff?cvsroot=cluster&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/ricci/DBusController.h.diff?cvsroot=cluster&r1=1.4&r2=1.5
--- conga/ricci/ricci/DBusController.cpp 2006/07/25 19:10:18 1.12
+++ conga/ricci/ricci/DBusController.cpp 2006/07/25 19:30:15 1.13
@@ -47,32 +47,8 @@
-DBusController::DBusController() :
- rhel4(false)
+DBusController::DBusController()
{
- char* buff = 0;
- string release;
- try {
- ifstream is("/etc/redhat-release");
- is.seekg(0, ios::end);
- unsigned int length = is.tellg();
- is.seekg(0, ios::beg);
- buff = new char[length];
- is.read(buff, length);
-
- string rel(buff, length);
- delete [] buff;
- buff = 0;
-
- release = utils::strip(rel);
- } catch ( ... ) {
- delete [] buff;
- throw;
- }
- if (release.find("Nahant") != release.npos)
- rhel4 = true;
-
-
// TODO: dynamically determine,
// currently, rpm requires storage and cluster modules
_mod_map["storage"] = "modstorage_rw";
@@ -149,13 +125,14 @@
string msg_clean(remove_chars(message, '\n'));
const char* msg_clean_c_str = msg_clean.c_str();
- // DBus API conformance dirty hack
const void* message_dbus_ready = 0;
- if (rhel4)
- message_dbus_ready = msg_clean_c_str;
- else
- message_dbus_ready = &msg_clean_c_str;
- // dirty hack done
+#if (DBUS_MAJOR_VERSION == 1) || (DBUS_MAJOR_VERSION == 0 && DBUS_MINOR_VERSION >= 90)
+ message_dbus_ready = &msg_clean_c_str;
+#elif DBUS_MAJOR_VERSION == 0 && DBUS_MINOR_VERSION < 90
+ message_dbus_ready = msg_clean_c_str;
+#else
+#error "unrecognized major DBUS number"
+#endif
if (!dbus_message_append_args(msg,
DBUS_TYPE_STRING, message_dbus_ready,
--- conga/ricci/ricci/DBusController.h 2006/05/23 17:45:38 1.4
+++ conga/ricci/ricci/DBusController.h 2006/07/25 19:30:15 1.5
@@ -48,11 +48,6 @@
private:
std::map<std::string, std::string> _mod_map;
-
- // DBus API conformace
- bool rhel4; // RHEL4's DBus
-
-
};
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-07-25 19:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-25 19:30 [Cluster-devel] conga/ricci/ricci DBusController.cpp DBusContr kupcevic
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.