[gvfs] burn: Use user runtime dir instead of /tmp
- From: Tomas Bzatek <tbzatek src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] burn: Use user runtime dir instead of /tmp
- Date: Tue, 7 Feb 2012 11:17:05 +0000 (UTC)
commit 989d0889afe34a0ce072edf9840b6d18314a00b3
Author: William Jon McCann <jmccann redhat com>
Date: Tue Feb 7 12:15:43 2012 +0100
burn: Use user runtime dir instead of /tmp
https://bugzilla.gnome.org/show_bug.cgi?id=646391
Signed-off-by: Tomas Bzatek <tbzatek redhat com>
daemon/gvfsbackendburn.c | 15 +++++----------
1 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/daemon/gvfsbackendburn.c b/daemon/gvfsbackendburn.c
index eddb47a..0725cb3 100644
--- a/daemon/gvfsbackendburn.c
+++ b/daemon/gvfsbackendburn.c
@@ -360,24 +360,19 @@ try_mount (GVfsBackend *backend,
gboolean is_automount)
{
GVfsBackendBurn *burn_backend = G_VFS_BACKEND_BURN (backend);
- char *tempdir, *filename;
- char *dir;
+ char *filename;
- filename = g_strdup_printf ("virtual-%s.XXXXXX", g_get_user_name ());
- tempdir = g_build_filename (g_get_tmp_dir (), filename, NULL);
- g_free (filename);
-
- dir = mkdtemp (tempdir);
- if (dir == NULL)
+ filename = g_build_filename (g_get_user_runtime_dir (), "gvfs-burn", NULL);
+ if (g_mkdir_with_parents (filename, 0700) < 0)
{
- g_free (tempdir);
+ g_free (filename);
g_vfs_job_failed (G_VFS_JOB (job),
G_IO_ERROR, G_IO_ERROR_FAILED,
_("Unable to create temporary directory"));
return TRUE;
}
- burn_backend->tempdir = dir;
+ burn_backend->tempdir = filename;
burn_backend->root_node =
virtual_node_new (NULL, VIRTUAL_NODE_DIRECTORY);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]