Print failing object path after failed bus lookup
Change-Id: I599d8297b4d2fd45831443685ea5b7d53f1515b6
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/apphandler.cpp b/apphandler.cpp
index dd1d5aa..abf0bd3 100644
--- a/apphandler.cpp
+++ b/apphandler.cpp
@@ -195,7 +195,8 @@
// Firmware revision is already implemented, so get it from appropriate position.
r = mapper_get_service(bus, objname, &busname);
if (r < 0) {
- fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-r));
+ fprintf(stderr, "Failed to get %s bus name: %s\n",
+ objname, strerror(-r));
goto finish;
}
r = sd_bus_get_property_string(bus,busname,objname,iface,"version", NULL, &ver);
@@ -284,7 +285,8 @@
// Call Get properties method with the interface and property name
r = mapper_get_service(bus, objname, &busname);
if (r < 0) {
- fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-r));
+ fprintf(stderr, "Failed to get %s bus name: %s\n",
+ objname, strerror(-r));
goto finish;
}
r = sd_bus_call_method(bus,busname,objname,iface,
@@ -407,7 +409,8 @@
// Get bus name
r = mapper_get_service(bus, objname, &busname);
if (r < 0) {
- fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-r));
+ fprintf(stderr, "Failed to get %s bus name: %s\n",
+ objname, strerror(-r));
goto finish;
}
// Set watchdog timer
@@ -473,7 +476,8 @@
// Get bus name
r = mapper_get_service(bus, objname, &busname);
if (r < 0) {
- fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-r));
+ fprintf(stderr, "Failed to get %s bus name: %s\n",
+ objname, strerror(-r));
goto finish;
}
// Refresh watchdog
diff --git a/chassishandler.cpp b/chassishandler.cpp
index 0b503c7..a20d062 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -79,7 +79,8 @@
r = mapper_get_service(bus, settings_object_name, &connection);
if (r < 0) {
- fprintf(stderr, "Failed to get connection, return value: %s.\n", strerror(-r));
+ fprintf(stderr, "Failed to get %s connection: %s\n",
+ settings_object_name, strerror(-r));
goto finish;
}
@@ -144,7 +145,8 @@
r = mapper_get_service(bus, settings_object_name, &connection);
if (r < 0) {
- fprintf(stderr, "Failed to get connection, return value: %s.\n", strerror(-r));
+ fprintf(stderr, "Failed to get %s connection: %s\n",
+ settings_object_name, strerror(-r));
goto finish;
}
@@ -572,7 +574,8 @@
sd_bus *bus_type = ipmid_get_sd_bus_connection();
rc = mapper_get_service(bus_type, chassis_object_name, &busname);
if (rc < 0) {
- fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-rc));
+ fprintf(stderr, "Failed to get %s bus name: %s\n",
+ chassis_object_name, strerror(-rc));
goto finish;
}
rc = sd_bus_call_method(bus_type, // On the System Bus
diff --git a/host-services.c b/host-services.c
index 4c8fc7c..b0b12ae 100644
--- a/host-services.c
+++ b/host-services.c
@@ -45,7 +45,8 @@
sd_bus *bus = ipmid_get_sd_bus_connection();
rc = mapper_get_service(bus, object_name, &bus_name);
if (rc < 0) {
- fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-rc));
+ fprintf(stderr, "Failed to get %s bus name: %s\n",
+ object_name, strerror(-rc));
goto finish;
}
rc = sd_bus_call_method(bus, // In the System Bus
diff --git a/ipmid.cpp b/ipmid.cpp
index 9e267bc..84d37ea 100644
--- a/ipmid.cpp
+++ b/ipmid.cpp
@@ -274,7 +274,8 @@
rc = mapper_get_service(bus, settings_host_object, &busname);
if (rc < 0) {
- fprintf(stderr, "Failed to get HOST busname: %s\n", strerror(-rc));
+ fprintf(stderr, "Failed to get %s busname: %s\n",
+ settings_host_object, strerror(-rc));
goto cleanup;
}
rc = sd_bus_call_method(bus,
diff --git a/sensorhandler.cpp b/sensorhandler.cpp
index 6503db8..b3381f3 100644
--- a/sensorhandler.cpp
+++ b/sensorhandler.cpp
@@ -117,7 +117,8 @@
int r;
r = mapper_get_service(bus, objname, &busname);
if (r < 0) {
- fprintf(stderr, "Failed to get system manager busname: %s\n", strerror(-r));
+ fprintf(stderr, "Failed to get %s busname: %s\n",
+ objname, strerror(-r));
goto final;
}
@@ -136,7 +137,8 @@
r = mapper_get_service(bus, str2, &str1);
if (r < 0) {
- fprintf(stderr, "Failed to get item busname: %s\n", strerror(-r));
+ fprintf(stderr, "Failed to get %s busname: %s\n",
+ str2, strerror(-r));
goto final;
}
diff --git a/storageaddsel.cpp b/storageaddsel.cpp
index 47328b0..87018e7 100644
--- a/storageaddsel.cpp
+++ b/storageaddsel.cpp
@@ -183,7 +183,8 @@
mbus = ipmid_get_sd_bus_connection();
r = mapper_get_service(mbus, object_name, &bus_name);
if (r < 0) {
- fprintf(stderr, "Failed to get connection, return value: %s.\n", strerror(-r));
+ fprintf(stderr, "Failed to get %s connection: %s\n",
+ object_name, strerror(-r));
goto finish;
}
r = sd_bus_message_new_method_call(mbus,&m,
diff --git a/testaddsel.cpp b/testaddsel.cpp
index 9fd9d35..4023629 100644
--- a/testaddsel.cpp
+++ b/testaddsel.cpp
@@ -27,7 +27,8 @@
r = mapper_get_service(bus, objname, &busname);
if (r < 0) {
- fprintf(stderr, "Failed to get busname: %s\n", strerror(-r));
+ fprintf(stderr, "Failed to get %s busname: %s\n",
+ objname, strerror(-r));
goto final;
}
@@ -110,4 +111,4 @@
sd_bus_unref(bus);
return 0;
-}
\ No newline at end of file
+}
diff --git a/transporthandler.cpp b/transporthandler.cpp
index 01a79cb..32ed993 100644
--- a/transporthandler.cpp
+++ b/transporthandler.cpp
@@ -57,7 +57,8 @@
r = mapper_get_service(bus, obj, &app);
if (r < 0) {
- fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-r));
+ fprintf(stderr, "Failed to get %s bus name: %s\n",
+ obj, strerror(-r));
goto cleanup;
}
r = sd_bus_call_method(bus, app, obj, ifc, "GetAddress4", &error,
@@ -185,7 +186,8 @@
r = mapper_get_service(bus, obj, &app);
if (r < 0) {
- fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-r));
+ fprintf(stderr, "Failed to get %s bus name: %s\n",
+ obj, strerror(-r));
goto finish;
}
r = sd_bus_call_method(bus, app, obj, ifc, "SetHwAddress", &error,
@@ -339,7 +341,8 @@
r = mapper_get_service(bus, obj, &app);
if (r < 0) {
- fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-r));
+ fprintf(stderr, "Failed to get %s bus name: %s\n",
+ obj, strerror(-r));
goto cleanup;
}
r = sd_bus_call_method(bus, app, obj, ifc, "GetHwAddress", &error,