chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Introduce cleanup functions for cap_free
[elogind.git]
/
src
/
libsystemd-bus
/
bus-dump.c
diff --git
a/src/libsystemd-bus/bus-dump.c
b/src/libsystemd-bus/bus-dump.c
index 71de081649c433caa14dd1eb609d370efaf4c5be..78e7597ed540bca227f9fb752b2be0e6e485f4be 100644
(file)
--- a/
src/libsystemd-bus/bus-dump.c
+++ b/
src/libsystemd-bus/bus-dump.c
@@
-19,8
+19,6
@@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/capability.h>
-
#include "util.h"
#include "capability.h"
#include "strv.h"
#include "util.h"
#include "capability.h"
#include "strv.h"
@@
-67,13
+65,13
@@
int bus_message_dump(sd_bus_message *m, FILE *f, bool with_header) {
/* Display synthetic message serial number in a more readable
* format than (uint32_t) -1 */
/* Display synthetic message serial number in a more readable
* format than (uint32_t) -1 */
- if (BUS_MESSAGE_
SERIAL
(m) == 0xFFFFFFFFULL)
- fprintf(f, "
Serial
=-1");
+ if (BUS_MESSAGE_
COOKIE
(m) == 0xFFFFFFFFULL)
+ fprintf(f, "
Cookie
=-1");
else
else
- fprintf(f, "
Serial=%u", BUS_MESSAGE_SERIAL
(m));
+ fprintf(f, "
Cookie=%lu", (unsigned long) BUS_MESSAGE_COOKIE
(m));
- if (m->reply_
serial
!= 0)
- fprintf(f, " Reply
Serial=%u", m->reply_serial
);
+ if (m->reply_
cookie
!= 0)
+ fprintf(f, " Reply
Cookie=%lu", (unsigned long) m->reply_cookie
);
fputs("\n", f);
fputs("\n", f);
@@
-117,7
+115,7
@@
int bus_message_dump(sd_bus_message *m, FILE *f, bool with_header) {
fprintf(f, " MESSAGE \"%s\" {\n", strempty(m->root_container.signature));
fprintf(f, " MESSAGE \"%s\" {\n", strempty(m->root_container.signature));
- for(;;) {
+ for
(;;) {
_cleanup_free_ char *prefix = NULL;
const char *contents = NULL;
char type;
_cleanup_free_ char *prefix = NULL;
const char *contents = NULL;
char type;
@@
-200,7
+198,7
@@
int bus_message_dump(sd_bus_message *m, FILE *f, bool with_header) {
break;
case SD_BUS_TYPE_BOOLEAN:
break;
case SD_BUS_TYPE_BOOLEAN:
- fprintf(f, "%sBOOLEAN %s%s%s;\n", prefix, ansi_highlight(),
yes_no
(basic.i), ansi_highlight_off());
+ fprintf(f, "%sBOOLEAN %s%s%s;\n", prefix, ansi_highlight(),
true_false
(basic.i), ansi_highlight_off());
break;
case SD_BUS_TYPE_INT16:
break;
case SD_BUS_TYPE_INT16:
@@
-281,12
+279,15
@@
static void dump_capabilities(
for (;;) {
if (r > 0) {
for (;;) {
if (r > 0) {
+ _cleanup_cap_free_charp_ char *t;
+
if (n > 0)
fputc(' ', f);
if (n % 4 == 3)
fputs("\n ", f);
if (n > 0)
fputc(' ', f);
if (n % 4 == 3)
fputs("\n ", f);
- fputs(cap_to_name(i), f);
+ t = cap_to_name(i);
+ fprintf(f, "%s", t);
n++;
}
n++;
}