[evolution-patches] e-mktemp patches



Noticed while hacking on a test program in connector


Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/e-util/ChangeLog,v
retrieving revision 1.470
diff -u -r1.470 ChangeLog
--- ChangeLog	2 Jul 2004 16:03:56 -0000	1.470
+++ ChangeLog	13 Jul 2004 15:03:18 -0000
@@ -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 ]
Index: e-mktemp.c
===================================================================
RCS file: /cvs/gnome/evolution/e-util/e-mktemp.c,v
retrieving revision 1.9
diff -u -r1.9 e-mktemp.c
--- e-mktemp.c	3 Mar 2004 06:24:19 -0000	1.9
+++ e-mktemp.c	13 Jul 2004 15:03:18 -0000
@@ -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,8 +60,6 @@
 	struct stat st;
 	int count = 0;
 
-	printf("expire dir '%s'\n", base);
-
 	dir = opendir(base);
 	if (dir == NULL)
 		return 0;
@@ -100,8 +98,6 @@
 	g_string_free(path, TRUE);
 	closedir(dir);
 
-	printf("expire dir '%s' %d remaining files\n", base, count);
-
 	return count;
 }
 
@@ -153,9 +149,6 @@
 	}
 #endif	
 
-	if (path)
-		printf("temp dir '%s'\n", path->str);
-
 	/* fire off an expirey attempt no more often than TEMP_SCAN seconds */
 	if (path && (last+TEMP_SCAN) < now) {
 		last = now;
@@ -165,7 +158,7 @@
 	return path;
 }
 
-const char *
+char *
 e_mktemp (const char *template)
 {
 	GString *path;
@@ -211,7 +204,7 @@
 }
 
 
-const char *
+char *
 e_mkdtemp (const char *template)
 {
 	GString *path;
Index: e-mktemp.h
===================================================================
RCS file: /cvs/gnome/evolution/e-util/e-mktemp.h,v
retrieving revision 1.2
diff -u -r1.2 e-mktemp.h
--- e-mktemp.h	27 Oct 2001 23:42:27 -0000	1.2
+++ e-mktemp.h	13 Jul 2004 15:03:18 -0000
@@ -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__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]