* @since_tizen 6.0
*
* @param[in] data Diagnostics data handle
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #DIAGNOSTICS_ERROR_NONE Success
+ * @retval #DIAGNOSTICS_ERROR_NOT_SUPPORTED Not supported
+ * @retval #DIAGNOSTICS_ERROR_INVALID_PARAMETER Provided parameter is invalid
*/
-void diagnostics_data_destroy(diagnostics_data_h data);
+int diagnostics_data_destroy(diagnostics_data_h data);
/**
* @brief Gets diagnostics context provider's id.
*
* @return 0 on success, otherwise a negative error value
* @retval #DIAGNOSTICS_ERROR_NONE Success
- * @retval #DIAGNOSTICS_ERROR_NOT_SUPPORTED Diagnostics data not supported with given context and parameters
+ * @retval #DIAGNOSTICS_ERROR_NOT_SUPPORTED Not supported
* @retval #DIAGNOSTICS_ERROR_PERMISSION_DENIED Permission denied
* @retval #DIAGNOSTICS_ERROR_INVALID_PARAMETER Provided parameter is invalid
* @retval #DIAGNOSTICS_ERROR_IO_ERROR Internal error occured
* @since_tizen 6.0
*
* @param[in] ctx Diagnostics context handle
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #DIAGNOSTICS_ERROR_NONE Success
+ * @retval #DIAGNOSTICS_ERROR_NOT_SUPPORTED Not supported
+ * @retval #DIAGNOSTICS_ERROR_INVALID_PARAMETER Provided parameter is invalid
*/
-void diagnostics_destroy(diagnostics_ctx_h ctx);
+int diagnostics_destroy(diagnostics_ctx_h ctx);
#ifdef __cplusplus
}
return DIAGNOSTICS_ERROR_NONE;
}
-void diagnostics_destroy(diagnostics_ctx_h ctx) {
- RET_IF(ctx == NULL);
+int diagnostics_destroy(diagnostics_ctx_h ctx) {
+ RETV_IF(ctx == NULL, DIAGNOSTICS_ERROR_INVALID_PARAMETER);
dbus_signal_cleanup(((struct _diagnostics_ctx_s *)ctx)->signal);
free(ctx);
+
+ return DIAGNOSTICS_ERROR_NONE;
}
-void diagnostics_data_destroy(diagnostics_data_h data) {
- RET_IF(data == NULL);
+int diagnostics_data_destroy(diagnostics_data_h data) {
+ RETV_IF(data == NULL, DIAGNOSTICS_ERROR_INVALID_PARAMETER);
close(((struct _diagnostics_data_s *)data)->fd);
free(data);
+
+ return DIAGNOSTICS_ERROR_NONE;
}