diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2007-11-15 06:04:21 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2007-11-15 06:04:21 +0800 |
commit | 9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91 (patch) | |
tree | 2e1e96f33404781354c422a7e9beaf458ebeb655 /e-util/e-mktemp.c | |
parent | 7e8f8bb9e5167b0219b48ab3e8062080d3740b0a (diff) | |
download | gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.gz gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.zst gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.zip |
** Remove trailing whitespace from source code.
2007-11-14 Matthew Barnes <mbarnes@redhat.com>
** Remove trailing whitespace from source code.
svn path=/trunk/; revision=34537
Diffstat (limited to 'e-util/e-mktemp.c')
-rw-r--r-- | e-util/e-mktemp.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/e-util/e-mktemp.c b/e-util/e-mktemp.c index 02a3e784fd..9ff294f929 100644 --- a/e-util/e-mktemp.c +++ b/e-util/e-mktemp.c @@ -107,10 +107,10 @@ get_dir (gboolean make) GString *path; time_t now = time(NULL); static time_t last = 0; - + #ifdef TEMP_HOME char *tmpdir = NULL; - tmpdir = g_build_filename(g_get_home_dir(), ".evolution", + tmpdir = g_build_filename(g_get_home_dir(), ".evolution", "cache", "tmp", NULL); path = g_string_new(tmpdir); if (make && g_mkdir_with_parents(tmpdir, 0777) == -1) { @@ -123,20 +123,20 @@ get_dir (gboolean make) g_string_append_printf (path, "%d", (int) getuid ()); if (make) { int ret; - + /* shoot now, ask questions later */ ret = g_mkdir (path->str, S_IRWXU); if (ret == -1) { if (errno == EEXIST) { struct stat st; - + if (g_stat (path->str, &st) == -1) { /* reset errno */ errno = EEXIST; g_string_free (path, TRUE); return NULL; } - + /* make sure this is a directory and belongs to us... */ if (!S_ISDIR (st.st_mode) || st.st_uid != getuid ()) { /* eek! this is bad... */ @@ -150,7 +150,7 @@ get_dir (gboolean make) } } } -#endif +#endif d(printf("temp dir '%s'\n", path ? path->str : "(null)")); @@ -168,20 +168,20 @@ e_mktemp (const char *template) { GString *path; char *ret; - + path = get_dir (TRUE); if (!path) return NULL; - + g_string_append_c (path, '/'); if (template) g_string_append (path, template); else g_string_append (path, "unknown-XXXXXX"); - + ret = mktemp (path->str); g_string_free(path, ret == NULL); - + return ret; } @@ -191,20 +191,20 @@ e_mkstemp (const char *template) { GString *path; int fd; - + path = get_dir (TRUE); if (!path) return -1; - + g_string_append_c (path, '/'); if (template) g_string_append (path, template); else g_string_append (path, "unknown-XXXXXX"); - + fd = g_mkstemp (path->str); g_string_free(path, TRUE); - + return fd; } @@ -214,17 +214,17 @@ e_mkdtemp (const char *template) { GString *path; char *tmpdir; - + path = get_dir (TRUE); if (!path) return NULL; - + g_string_append_c (path, '/'); if (template) g_string_append (path, template); else g_string_append (path, "unknown-XXXXXX"); - + #ifdef HAVE_MKDTEMP tmpdir = mkdtemp (path->str); #else @@ -235,6 +235,6 @@ e_mkdtemp (const char *template) } #endif g_string_free(path, tmpdir == NULL); - + return tmpdir; } |