diff options
author | Dan Winship <danw@src.gnome.org> | 2004-07-14 23:19:58 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2004-07-14 23:19:58 +0800 |
commit | 109c235bb23836ebe9a95bd5862a0e7ead568236 (patch) | |
tree | 90e68bc738c7d2a7879c6240f4a937ec2091f951 | |
parent | 1dcf7c2a308edb953759b4abd5e0f8e1f94050dd (diff) | |
download | gsoc2013-evolution-109c235bb23836ebe9a95bd5862a0e7ead568236.tar.gz gsoc2013-evolution-109c235bb23836ebe9a95bd5862a0e7ead568236.tar.zst gsoc2013-evolution-109c235bb23836ebe9a95bd5862a0e7ead568236.zip |
un-const the return values, since they need to be freed (d): turn off
* e-mktemp.c (e_mktemp, e_mkdtemp): un-const the return values,
since they need to be freed
(d): turn off debugging
(expire_dir_rec): remove debug printfs
svn path=/trunk/; revision=26647
-rw-r--r-- | e-util/ChangeLog | 7 | ||||
-rw-r--r-- | e-util/e-mktemp.c | 13 | ||||
-rw-r--r-- | e-util/e-mktemp.h | 6 |
3 files changed, 16 insertions, 10 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 2e8cc8b4d4..d9da256403 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,10 @@ +2004-07-12 Dan Winship <danw@novell.com> + + * e-mktemp.c (e_mktemp, e_mkdtemp): un-const the return values, + since they need to be freed + (d): turn off debugging + (expire_dir_rec): remove debug printfs + 2004-07-02 Chris Toshok <toshok@ximian.com> [ fixes #60691 ] diff --git a/e-util/e-mktemp.c b/e-util/e-mktemp.c index 2e40a4d8a2..9e5b8f7ba0 100644 --- a/e-util/e-mktemp.c +++ b/e-util/e-mktemp.c @@ -40,7 +40,7 @@ #include "e-mktemp.h" -#define d(x) x +#define d(x) /* define to put temporary files in ~/evolution/cache/tmp */ #define TEMP_HOME (1) @@ -60,7 +60,7 @@ expire_dir_rec(const char *base, time_t now) struct stat st; int count = 0; - printf("expire dir '%s'\n", base); + d(printf("expire dir '%s'\n", base)); dir = opendir(base); if (dir == NULL) @@ -100,7 +100,7 @@ expire_dir_rec(const char *base, time_t now) g_string_free(path, TRUE); closedir(dir); - printf("expire dir '%s' %d remaining files\n", base, count); + d(printf("expire dir '%s' %d remaining files\n", base, count)); return count; } @@ -153,8 +153,7 @@ get_dir (gboolean make) } #endif - if (path) - printf("temp dir '%s'\n", path->str); + d(printf("temp dir '%s'\n", path ? path->str : "(null)")); /* fire off an expirey attempt no more often than TEMP_SCAN seconds */ if (path && (last+TEMP_SCAN) < now) { @@ -165,7 +164,7 @@ get_dir (gboolean make) return path; } -const char * +char * e_mktemp (const char *template) { GString *path; @@ -211,7 +210,7 @@ e_mkstemp (const char *template) } -const char * +char * e_mkdtemp (const char *template) { GString *path; diff --git a/e-util/e-mktemp.h b/e-util/e-mktemp.h index b5eb587d86..14fbb9bcc8 100644 --- a/e-util/e-mktemp.h +++ b/e-util/e-mktemp.h @@ -23,10 +23,10 @@ #ifndef __E_MKTEMP_H__ #define __E_MKTEMP_H__ -const char *e_mktemp (const char *template); +char *e_mktemp (const char *template); -int e_mkstemp (const char *template); +int e_mkstemp (const char *template); -const char *e_mkdtemp (const char *template); +char *e_mkdtemp (const char *template); #endif /* __E_MKTEMP_H__ */ |