Permalink
Browse files

- fixed type of time_t in DBus protocol (it is signed)

  • Loading branch information...
1 parent 7fc18fa commit 753c75810841c1d232d1730c91fe2b6979827355 @aschnell aschnell committed Jan 24, 2013
View
@@ -73,7 +73,7 @@ XSnapshots::findPost(const_iterator pre) const
namespace DBus
{
const char* TypeInfo<XConfigInfo>::signature = "(ssa{ss})";
- const char* TypeInfo<XSnapshot>::signature = "(uqutussa{ss})";
+ const char* TypeInfo<XSnapshot>::signature = "(uquxussa{ss})";
const char* TypeInfo<XFile>::signature = "(su)";
View
@@ -254,7 +254,7 @@ namespace DBus
Hihi&
operator>>(Hihi& hihi, time_t& data)
{
- if (hihi.get_type() != DBUS_TYPE_UINT64)
+ if (hihi.get_type() != DBUS_TYPE_INT64)
throw MarshallingException();
dbus_uint64_t tmp;
@@ -270,7 +270,7 @@ namespace DBus
operator<<(Hoho& hoho, time_t data)
{
dbus_uint64_t tmp = data;
- if (!dbus_message_iter_append_basic(hoho.top(), DBUS_TYPE_UINT64, &tmp))
+ if (!dbus_message_iter_append_basic(hoho.top(), DBUS_TYPE_INT64, &tmp))
throw FatalException();
return hoho;
@@ -29,7 +29,7 @@
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
-#define CDBUS_SIG_LIST_SNAPS_RSP "a(uqutussa{ss})"
+#define CDBUS_SIG_LIST_SNAPS_RSP "a(uquxussa{ss})"
#define CDBUS_SIG_LIST_CONFS_RSP "a(ssa{ss})"
#define CDBUS_SIG_CREATE_SNAP_RSP "u"
#define CDBUS_SIG_DEL_SNAPS_RSP ""
@@ -44,7 +44,7 @@ struct snap {
uint32_t id;
uint16_t type;
uint32_t pre_id;
- uint64_t time;
+ int64_t time;
uint32_t creator_uid;
char *desc;
char *cleanup;
@@ -285,7 +285,7 @@ static int snap_struct_unpack(DBusMessageIter *iter,
}
dbus_message_iter_next(&st_iter);
- ret = cdbus_type_check_get(&st_iter, DBUS_TYPE_UINT64,
+ ret = cdbus_type_check_get(&st_iter, DBUS_TYPE_INT64,
&snap_out->time);
if (ret < 0) {
return ret;
@@ -339,7 +339,7 @@ static void snap_array_print(int32_t num_snaps,
printf("id: %u\n"
"type: %u\n"
"pre_id: %u\n"
- "time: %" PRIu64 "\n"
+ "time: %" PRId64 "\n"
"creator_uid: %u\n"
"desc: %s\n"
"cleanup: %s\n",
@@ -15,7 +15,7 @@
for snapshot in snapshots:
print snapshot[0], snapshot[1], snapshot[2],
- if snapshot[3] != 0xFFFFFFFFFFFFFFFF:
+ if snapshot[3] != -1:
print asctime(gmtime(snapshot[3])),
else:
print "now",
View
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Thu Jan 24 14:32:02 CET 2013 - aschnell@suse.de
+
+- fixed type of time_t in DBus protocol
+
-------------------------------------------------------------------
Mon Nov 26 12:40:54 CET 2012 - aschnell@suse.de
View
@@ -230,15 +230,15 @@ Client::introspect(DBus::Connection& conn, DBus::Message& msg)
" <method name='ListSnapshotsAtTime'>\n"
" <arg name='config-name' type='s' direction='in'/>\n"
- " <arg name='begin' type='t' direction='in'/>\n"
- " <arg name='end' type='t' direction='in'/>\n"
+ " <arg name='begin' type='x' direction='in'/>\n"
+ " <arg name='end' type='x' direction='in'/>\n"
" <arg name='snapshots' type='v' direction='out'/>\n"
" </method>\n"
" <method name='GetSnapshot'>\n"
" <arg name='config-name' type='s' direction='in'/>\n"
" <arg name='number' type='u' direction='in'/>\n"
- " <arg name='type' type='(uqutussa{ss})' direction='out'/>\n"
+ " <arg name='type' type='(uquxussa{ss})' direction='out'/>\n"
" </method>\n"
" <method name='SetSnapshot'>\n"
View
@@ -26,7 +26,7 @@
namespace DBus
{
const char* TypeInfo<ConfigInfo>::signature = "(ssa{ss})";
- const char* TypeInfo<Snapshot>::signature = "(uqutussa{ss})";
+ const char* TypeInfo<Snapshot>::signature = "(uquxussa{ss})";
const char* TypeInfo<File>::signature = "(su)";

0 comments on commit 753c758

Please sign in to comment.