summaryrefslogtreecommitdiffstats
path: root/src/service-dbus
diff options
context:
space:
mode:
authorJan Synacek <jsynacek@redhat.com>2014-04-29 08:33:13 +0200
committerJan Synacek <jsynacek@redhat.com>2014-04-30 15:54:14 +0200
commit55f63d29f5d2b4e82979d71386df58394e87ef5a (patch)
tree34227f5696df9b3a85c5999d2fd48f50be82681f /src/service-dbus
parentdab89c6afb2a2b339ebadea3d47e841cd749b5ef (diff)
downloadopenlmi-providers-55f63d29f5d2b4e82979d71386df58394e87ef5a.tar.gz
openlmi-providers-55f63d29f5d2b4e82979d71386df58394e87ef5a.tar.xz
openlmi-providers-55f63d29f5d2b4e82979d71386df58394e87ef5a.zip
libopenlmi: reorganize and gather
Make naming consistent. Gather common functionality into one library and try to use it across all providers. Introduce libtool-style versioning for libraries.
Diffstat (limited to 'src/service-dbus')
-rw-r--r--src/service-dbus/CMakeLists.txt2
-rw-r--r--src/service-dbus/LMI_ServiceProvider.c9
-rw-r--r--src/service-dbus/util/serviceutil.h2
3 files changed, 5 insertions, 8 deletions
diff --git a/src/service-dbus/CMakeLists.txt b/src/service-dbus/CMakeLists.txt
index 4ba3231..b1c42f1 100644
--- a/src/service-dbus/CMakeLists.txt
+++ b/src/service-dbus/CMakeLists.txt
@@ -28,7 +28,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}
${GIO_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/src/indmanager)
target_link_libraries(${LIBRARY_NAME}
- openlmicommon
+ openlmi
openlmiindmanager
${KONKRETCMPI_LIBRARIES}
${GIO_LIBRARIES})
diff --git a/src/service-dbus/LMI_ServiceProvider.c b/src/service-dbus/LMI_ServiceProvider.c
index 709faa5..1f370c1 100644
--- a/src/service-dbus/LMI_ServiceProvider.c
+++ b/src/service-dbus/LMI_ServiceProvider.c
@@ -23,7 +23,6 @@
#include <stdint.h>
#include "LMI_Service.h"
#include "util/serviceutil.h"
-#include "globals.h"
static const CMPIBroker* _cb = NULL;
@@ -48,7 +47,7 @@ static CMPIStatus LMI_ServiceEnumInstanceNames(
{
const char *ns = KNameSpace(cop);
SList *slist = NULL;
- char output[1024];
+ char output[BUFLEN];
slist = service_find_all(output, sizeof(output));
if (slist == NULL) {
@@ -79,7 +78,7 @@ static CMPIStatus LMI_ServiceEnumInstances(
{
AllServices *svcs = NULL;
CMPIStatus status;
- char output[1024];
+ char output[BUFLEN];
if ((svcs = service_get_properties_all(output, sizeof(output))) != NULL) {
for(int i = 0; i < svcs->cnt; i++) {
@@ -130,7 +129,7 @@ static CMPIStatus LMI_ServiceGetInstance(
const CMPIObjectPath* cop,
const char** properties)
{
- char output[1024];
+ char output[BUFLEN];
int res;
LMI_Service w;
LMI_Service_InitFromObjectPath(&w, _cb, cop);
@@ -260,7 +259,7 @@ KUint32 LMI_Service_RequestStateChange(
unsigned int Service_RunOperation(const char *service, const char *operation, CMPIStatus *status)
{
- char output[1024];
+ char output[BUFLEN];
int res = service_operation(service, operation, output, sizeof(output));
if (res == 0) {
KSetStatus2(_cb, status, OK, output);
diff --git a/src/service-dbus/util/serviceutil.h b/src/service-dbus/util/serviceutil.h
index c5b0abf..4c2b63f 100644
--- a/src/service-dbus/util/serviceutil.h
+++ b/src/service-dbus/util/serviceutil.h
@@ -28,8 +28,6 @@
#include "openlmi.h"
#include "LMI_Service.h"
-#define ARRAY_SIZE(name) (sizeof(name) / sizeof(name[0]))
-
/* systemd job result string */
#define JR_DONE "done"