#include <errno.h>
#include <string.h>
#include <unistd.h>
-#include <sys/wait.h>
#ifdef HAVE_CRT_EXTERNS_H
#include <crt_externs.h>
* the connection if we were the initial owner.
*/
g_dbus_connection_flush (session_bus, NULL, NULL, NULL);
- g_object_unref (session_bus);
}
completed = TRUE;
out:
+ g_clear_object (&session_bus);
g_strfreev (argv);
g_strfreev (envp);
gpointer data)
{
/* Did the application exit correctly */
- if (WIFEXITED (status) &&
- WEXITSTATUS (status) == 0)
+ if (g_spawn_check_exit_status (status, NULL))
{
/* Here we could clean out any caches in use */
}
close (fd);
res = g_file_set_contents (filename, data, data_size, error);
+ g_free (data);
if (!res)
{
g_free (desktop_id);