{
struct json_object sub_json;
struct json_object opens_json;
+ struct timeval_buf tv_buf;
int result = 0;
+ char *timestr;
bool add_lease = false;
char *key = NULL;
char *share_file_id = NULL;
goto failure;
}
+ timestr = timeval_str_buf(&e->time, true, true, &tv_buf);
+ if (timestr == NULL) {
+ goto failure;
+ }
+ result = json_add_string(&sub_json, "opened_at", timestr);
+ if (result < 0) {
+ goto failure;
+ }
+
pid = server_id_str_buf(e->pid, &tmp);
key = talloc_asprintf(tmp_ctx, "%s/%lu", pid, e->share_file_id);
result = json_add_object(&opens_json, key, &sub_json);