Name: capi-media-controller
Summary: A media controller library in Tizen Native API
-Version: 1.0.0
+Version: 1.0.1
Release: 1
Group: Multimedia/API
License: Apache-2.0
%endif
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-SO_FULLVER=0.3.0
+SO_FULLVER=0.3.1
SO_MAJORVER=`echo ${SO_FULLVER} | awk 'BEGIN {FS="."}{print $1}'`
%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DSO_FULLVER=${SO_FULLVER} -DSO_MAJORVER=${SO_MAJORVER} \
%if %{on_demand}
int fd = 0;
gchar *path = NULL;
const char *template = "XXXXXX.mc";
- GError *error = NULL;
+ g_autoptr(GError) error = NULL;
fd = g_file_open_tmp(template, &path, &error);
if (fd < 0) {
mc_secure_error("g_file_open_tmp error [%s]", (error ? error->message : "none"));
- g_error_free(error);
return NULL;
}
gchar *_mc_util_write_message_to_file(const gchar *data, gssize size)
{
- gchar *path = _mc_util_make_message_file();
- GError *error = NULL;
+ g_autofree gchar *path = NULL;
+ g_autoptr(GError) error = NULL;
- mc_retvm_if(!MC_STRING_VALID(path), NULL, "invalid path %s", path);
mc_retvm_if(!data, NULL, "data is null");
mc_retvm_if(size == 0, NULL, "size is 0");
mc_debug_fenter();
+ path = _mc_util_make_message_file();
+ mc_retvm_if(!path, NULL, "Making message file was failed");
+
if (!g_file_set_contents(path, data, size, &error)) {
mc_secure_error("g_file_set_contents error(%s: %s)", path, (error ? error->message : "none"));
- if (error)
- g_error_free(error);
- g_free(path);
return NULL;
}
mc_debug_fleave();
- return path;
+ return g_steal_pointer(&path);
}