#include <fcntl.h>
#include <sys/stat.h>
#include <poll.h>
+#include <inttypes.h>
#include "daemon/mm_resource_manager_daemon_priv.h"
#include "daemon/mm_resource_manager_daemon_conf.h"
MM_RM_RETVM_IF(i_man == MM_RESOURCE_MANGER_NOT_FOUND,
MM_RESOURCE_MANAGER_ERROR_INVALID_PARAMETER,
- "Resource manager #%llx doesn't exist", _mm_rm_hash64(id));
+ "Resource manager #%"PRIu64" doesn't exist", _mm_rm_hash64(id));
__release_all_resources((mm_resource_manager_dmn_s*)managers->pdata[i_man]);
mm_resource_manager_backend_commit_all();
MM_RM_RETVM_IF(manager == NULL,
MM_RESOURCE_MANAGER_ERROR_INVALID_PARAMETER,
- "Resource manager #%llx doesn't exist", _mm_rm_hash64(id));
+ "Resource manager #%"PRIu64" doesn't exist", _mm_rm_hash64(id));
MM_RM_RETVM_IF(
(releases == NULL || releases[0].type == MM_RESOURCE_MANAGER_NO_RES) &&
(acquires == NULL || acquires[0].type == MM_RESOURCE_MANAGER_NO_RES),
i_man->resources[request->type]->parts = NULL;
i_man->resources[request->type]->is_acquired = FALSE;
- MM_RM_DEBUG("All parts of %s are released in RM #%llx",
+ MM_RM_DEBUG("All parts of %s are released in RM %"PRIu64,
res_name, _mm_rm_hash64(i_man->id));
} else {
__add_cb_request(cb_requests, i_man, request->type,
i_man->resources[request->type]->is_acquired = FALSE;
- MM_RM_DEBUG("Full resource %s is released in RM #%llx",
+ MM_RM_DEBUG("Full resource %s is released in RM %"PRIu64,
res_name, _mm_rm_hash64(i_man->id));
break;
}
i_man->resources[request->type]->is_acquired = FALSE;
is_released_fully = TRUE;
- MM_RM_DEBUG("Full resource %s is released in RM #%llx",
+ MM_RM_DEBUG("Full resource %s is released in RM %"PRIu64,
res_name, _mm_rm_hash64(i_man->id));
break;
}
enough_volume = request->volume + acquired_volume <=
conf->max_volume[request->type];
- MM_RM_DEBUG("%d units of %s are released in RM #%llx",
+ MM_RM_DEBUG("%d units of %s are released in RM %"PRIu64,
g_array_index(parts,
mm_resource_manager_res_volume, 0), res_name,
_mm_rm_hash64(i_man->id));
if (!parts->len) {
MM_RM_DEBUG("Part array of %s is empty and will be "
- "freed in RM #%llx", res_name,
+ "freed in RM %"PRIu64, res_name,
_mm_rm_hash64(i_man->id));
g_array_free(parts, TRUE);
i_man->resources[request->type]->parts = NULL;
mm_resource_manager_dmn_release_cb_request_s, i);
id = request->manager->id;
MM_RM_HASH64(id);
- MM_RM_DEBUG("Sending release callback to RM #%llx for %s of volume %d",
+ MM_RM_DEBUG("Sending release callback to RM #%"PRIu64" for %s of volume %d",
id, _mm_resource_manager_get_res_str(request->type),
request->volume);
_mmrm_dmn_dbus_release_callback(id, request->type, request->volume);
if (read_size == sizeof(recv_id)) {
ret = id == recv_id;
if (ret == FALSE)
- MM_RM_ERROR("Sync is received from wrong client #%llx",
+ MM_RM_ERROR("Sync is received from wrong client #%"PRIu64,
recv_id);
/*
* Wait POLLHUP to avoid situation when client sent last sync
(sync.revents & (POLLHUP | POLLERR)) == 0)
MM_RM_ERROR("The client didn't close the FIFO");
} else {
- MM_RM_ERROR("Read is failed (revents=%hd,read_size=%d)",
+ MM_RM_ERROR("Read is failed (revents=%hd,read_size=%zd)",
sync.revents, read_size);
ret = FALSE;
}
g_mutex_lock(&handles_lock);
g_ptr_array_add(handles, handle);
- MM_RM_INFO("Resource manager #%llx is created", _mm_rm_hash64(handle->id));
+ MM_RM_INFO("Resource manager #%"PRIu64" is created", _mm_rm_hash64(handle->id));
g_mutex_unlock(&handles_lock);
return MM_RESOURCE_MANAGER_ERROR_NONE;
free(handle);
if (ret == MM_RESOURCE_MANAGER_ERROR_NONE)
- MM_RM_INFO("Resource manager #%llx is destroyed", _mm_rm_hash64(id));
+ MM_RM_INFO("Resource manager #%"PRIu64" is destroyed", _mm_rm_hash64(id));
return ret;
}
*resource_h = resource;
MM_RM_INFO("Resource %p of type %d with volume %d is marked for acquire in "
- "resource manager #%llx", *resource_h, type, volume,
+ "resource manager #%"PRIu64, *resource_h, type, volume,
_mm_rm_hash64(handle->id));
g_mutex_unlock(&handle->resources_lock);
break;
}
- MM_RM_INFO("Resource %p is resized for acquire in resource manager #%llx",
+ MM_RM_INFO("Resource %p is resized for acquire in resource manager #%"PRIu64,
resource_h, _mm_rm_hash64(handle->id));
g_mutex_unlock(&handle->resources_lock);
__mark_resource_for_release(handle->resources, i, resource);
- MM_RM_INFO("Resource %p is marked for release in resource manager #%llx",
+ MM_RM_INFO("Resource %p is marked for release in resource manager #%"PRIu64,
resource_h, _mm_rm_hash64(handle->id));
g_mutex_unlock(&handle->resources_lock);
}
}
- MM_RM_INFO("All resources are marked for release in resource manager #%llx",
+ MM_RM_INFO("All resources are marked for release in resource manager #%"PRIu64,
_mm_rm_hash64(handle->id));
g_mutex_unlock(&handle->resources_lock);
info->volume = resource->volume;
info->is_acquire_failed = resource->is_acquire_failed;
- MM_RM_INFO("Info structure of resource %p in resource manager #%llx is filled",
+ MM_RM_INFO("Info structure of resource %p in resource manager #%"PRIu64" is filled",
resource_h, _mm_rm_hash64(handle->id));
g_mutex_unlock(&handle->resources_lock);
ret = __dbus_commit(handle);
if (ret == MM_RESOURCE_MANAGER_ERROR_NONE) {
- MM_RM_INFO("Changes in resource manager #%llx have been committed successfully",
+ MM_RM_INFO("Changes in resource manager #%"PRIu64" have been committed successfully",
_mm_rm_hash64(handle->id));
} else {
MM_RM_ERROR("Dbus commit request failed");
handle->status_cb.user_data = user_data;
g_mutex_unlock(&handle->resources_lock);
- MM_RM_INFO("Status callback %p in resource manager #%llx is set", cb,
+ MM_RM_INFO("Status callback %p in resource manager #%"PRIu64" is set", cb,
_mm_rm_hash64(handle->id));
return MM_RESOURCE_MANAGER_ERROR_NONE;
gboolean release_all = FALSE;
int j;
- MM_RM_DEBUG("Release callback is emitted for %s of volume %d in RM #%llx",
+ MM_RM_DEBUG("Release callback is emitted for %s of volume %d in RM #%"PRIu64,
_mm_resource_manager_get_res_str(type), volume, id);
handle_id = handle->id;
&rm_error, NULL, &error);
MM_RM_RET_IF_GERR(error, "DBus create msg cannot be sent");
- MM_RM_DEBUG("Create returned id - #%llx, error - %d",
+ MM_RM_DEBUG("Create returned id - #%"PRIu64", error - %d",
_mm_rm_hash64(handle->id), rm_error);
return rm_error;
NULL, &error);
MM_RM_RET_IF_GERR(error, "DBus destroy msg cannot be sent");
- MM_RM_DEBUG("Destroy for id - #%llx returned error - %d",
+ MM_RM_DEBUG("Destroy for id - #%"PRIu64" returned error - %d",
_mm_rm_hash64(handle->id), rm_error);
return MM_RESOURCE_MANAGER_ERROR_NONE;
if (error != NULL)
MM_RM_RET_IF_GERR(error, "DBus commit msg cannot be sent");
- MM_RM_DEBUG("Commit for id - #%llx returned error - %d",
+ MM_RM_DEBUG("Commit for id - #%"PRIu64" returned error - %d",
_mm_rm_hash64(handle->id), rm_error);
if (rm_error == MM_RESOURCE_MANAGER_ERROR_NONE) {