All of lore.kernel.org
 help / color / mirror / Atom feed
From: kupcevic@sourceware.org <kupcevic@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/ricci/ricci DBusController.cpp DBusContr ...
Date: 25 Jul 2006 19:30:16 -0000	[thread overview]
Message-ID: <20060725193016.14078.qmail@sourceware.org> (raw)

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
-  
-  
 };
 
 



                 reply	other threads:[~2006-07-25 19:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060725193016.14078.qmail@sourceware.org \
    --to=kupcevic@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.