Skip to content

Commit

Permalink
Pass integer parameters to sd_bus_message_append correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
torokati44 committed May 28, 2020
1 parent c47d4b2 commit 32182d8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions notify.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,15 @@ void notify(sd_bus* bus, const char* summary, const char* body)
}
// Fill out the parameters according to
// https://developer.gnome.org/notification-spec/#command-notify
uint32_t u = 0;
int32_t i = -1;
ret = sd_bus_message_append(m, "susssasa{sv}i",
"system-notify", // STRING app_name
&u, // UINT32 replaces_id
0, // UINT32 replaces_id
"utilities-system-monitor", // STRING app_icon
summary, // STRING summary
body, // STRING body
0, // ARRAY actions
0, // DICT hints
&i // INT32 expire_timeout
-1 // INT32 expire_timeout
);
if (ret < 0) {
fprintf(stderr, "sd_bus_message_append: %s\n", strerror(-ret));
Expand Down

0 comments on commit 32182d8

Please sign in to comment.