Skip to content
Snippets Groups Projects
Commit 17eaf989 authored by Utz-Uwe Haus's avatar Utz-Uwe Haus
Browse files

serialize timestamp attribute properly

parent f11c1ec8
Branches
Tags
No related merge requests found
Pipeline #35631 failed
......@@ -2548,8 +2548,23 @@ mstro_attribute_entry_to_mapentry(const struct mstro_attribute_entry_ *entry,
INFO("POINTER type not serialized\n");
s=MSTRO_NOENT;
break;
case MSTRO_STP_TIMESTAMP: {
res->val->val_case = MSTRO__POOL__AVAL__VAL_TIMESTAMP;
res->val->timestamp = malloc(sizeof(Mstro__Pool__Timestamp));
if(res->val->timestamp==NULL) {
ERR("Failed to allocate timestamp AVal\n");
s=MSTRO_NOMEM;
}
mstro__pool__timestamp__init(res->val->timestamp);
const mstro_timestamp *src = (mstro_timestamp*)entry->val;
res->val->timestamp->sec = src->sec;
res->val->timestamp->nsec = src->nsec;
res->val->timestamp->offset = src->offset;
break;
}
default:
ERR("Unsupported attribute type, can not serialize: %d\n");
ERR("Unsupported attribute type for |%s|, can not serialize: %d\n",
res->key, entry->kind);
s=MSTRO_FAIL;
break;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment