diff -ruN Thunar-0.3.2beta2/plugins/thunar-sendto-email/main.c Thunar-0.3.2beta2.new/plugins/thunar-sendto-email/main.c --- Thunar-0.3.2beta2/plugins/thunar-sendto-email/main.c 2006-07-09 13:37:18.000000000 -0400 +++ Thunar-0.3.2beta2.new/plugins/thunar-sendto-email/main.c 2006-08-30 04:07:42.072188000 -0400 @@ -46,6 +46,9 @@ #ifdef HAVE_STRING_H #include #endif +#ifdef HAVE_TIME_H +#include +#endif #ifdef HAVE_UNISTD_H #include #endif @@ -317,6 +320,43 @@ +static gchar* +mkdtemp (gchar *tmpl) +{ + static const gchar LETTERS[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + static guint64 value; + guint64 v; + gint len; + gint i, j; + + len = strlen (tmpl); + if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX") != 0) + { + errno = EINVAL; + return NULL; + } + + value += ((guint64) time (NULL)) ^ getpid (); + + for (i = 0; i < TMP_MAX; ++i, value += 7777) + { + /* fill in the random bits */ + for (j = 0, v = value; j < 6; ++j) + tmpl[(len - 6) + j] = LETTERS[v % 62]; v /= 62; + + /* try to create the directory */ + if (g_mkdir (tmpl, 0700) == 0) + return tmpl; + else if (errno != EEXIST) + return NULL; + } + + errno = EEXIST; + return NULL; +} + + + static gboolean tse_compress (GList *infos, gchar **zipfile_return) diff -ruN Thunar-0.3.2beta2/thunar/thunar-shortcuts-view.c Thunar-0.3.2beta2.new/thunar/thunar-shortcuts-view.c --- Thunar-0.3.2beta2/thunar/thunar-shortcuts-view.c 2006-07-09 13:37:14.000000000 -0400 +++ Thunar-0.3.2beta2.new/thunar/thunar-shortcuts-view.c 2006-08-30 04:05:36.598650000 -0400 @@ -703,7 +703,7 @@ } /* call the parent's handler */ - return (*GTK_WIDGET_CLASS (thunar_shortcuts_view_parent_class)->drag_leave) (widget, context, time); + (*GTK_WIDGET_CLASS (thunar_shortcuts_view_parent_class)->drag_leave) (widget, context, time); } diff -ruN Thunar-0.3.2beta2/thunar/thunar-tree-view.c Thunar-0.3.2beta2.new/thunar/thunar-tree-view.c --- Thunar-0.3.2beta2/thunar/thunar-tree-view.c 2006-07-09 13:37:15.000000000 -0400 +++ Thunar-0.3.2beta2.new/thunar/thunar-tree-view.c 2006-08-30 04:05:36.603186000 -0400 @@ -860,7 +860,7 @@ } /* call the parent's handler */ - return (*GTK_WIDGET_CLASS (thunar_tree_view_parent_class)->drag_leave) (widget, context, time); + (*GTK_WIDGET_CLASS (thunar_tree_view_parent_class)->drag_leave) (widget, context, time); } diff -ruN Thunar-0.3.2beta2/thunar-vfs/thunar-vfs-info.c Thunar-0.3.2beta2.new/thunar-vfs/thunar-vfs-info.c --- Thunar-0.3.2beta2/thunar-vfs/thunar-vfs-info.c 2006-07-09 13:37:20.000000000 -0400 +++ Thunar-0.3.2beta2.new/thunar-vfs/thunar-vfs-info.c 2006-08-30 04:05:36.605617000 -0400 @@ -223,7 +223,7 @@ thunar_vfs_info_get_free_space (const ThunarVfsInfo *info, ThunarVfsFileSize *free_space_return) { -#if defined(HAVE_STATFS) && !defined(__sgi__) && !defined(__sun__) +#if defined(HAVE_STATFS) && !defined(__sgi__) && !defined(__sun__) && !defined(__sun) struct statfs statfsb; #elif defined(HAVE_STATVFS) struct statvfs statvfsb; @@ -237,7 +237,7 @@ if (thunar_vfs_path_to_string (info->path, absolute_path, sizeof (absolute_path), NULL) < 0) return FALSE; -#if defined(HAVE_STATFS) && !defined(__sgi__) && !defined(__sun__) +#if defined(HAVE_STATFS) && !defined(__sgi__) && !defined(__sun__) && !defined(__sun) if (statfs (absolute_path, &statfsb) == 0) { /* good old BSD way */ diff -ruN Thunar-0.3.2beta2/thunar-vfs/thunar-vfs-scandir.c Thunar-0.3.2beta2.new/thunar-vfs/thunar-vfs-scandir.c --- Thunar-0.3.2beta2/thunar-vfs/thunar-vfs-scandir.c 2006-07-09 13:37:20.000000000 -0400 +++ Thunar-0.3.2beta2.new/thunar-vfs/thunar-vfs-scandir.c 2006-08-30 04:05:36.606814000 -0400 @@ -72,7 +72,7 @@ /* %&§$!# IRIX and Solaris */ #if defined(__sgi__) && !defined(dirfd) #define dirfd(dp) (((DIR *) (dp))->__dd_fd) -#elif defined(__sun__) && !defined(dirfd) +#elif (defined(__sun__) || defined(__sun)) && !defined(dirfd) #define dirfd(dp) (((DIR *) (dp))->dd_fd) #endif