diff --git a/ChangeLog b/ChangeLog
index 70ba67d765702bb4dc82be4a50e5336add74fdcb..0f9301cbc072f0bbcd419af9c8b710a36ebcb5e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-07-31	Benedikt Meurer <benny@xfce.org>
+
+	* thunar-vfs/thunar-vfs-transfer-job.c: Include <time.h> since we
+	  use the time() library call. g_chmod() will be introduced with GLib
+	  2.8.0, so adjust the check.
+
 2005-07-31	Benedikt Meurer <benny@xfce.org>
 
 	* thunar/thunar-clipboard-manager.c
diff --git a/thunar-vfs/thunar-vfs-transfer-job.c b/thunar-vfs/thunar-vfs-transfer-job.c
index fe23258c3b5f13875c2f5cc0900066eb66fdbf9f..e5fd4773f8fdf5ab8e2c3f6fd4c026ed8ea46e9e 100644
--- a/thunar-vfs/thunar-vfs-transfer-job.c
+++ b/thunar-vfs/thunar-vfs-transfer-job.c
@@ -44,6 +44,9 @@
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -54,13 +57,15 @@
 #if GLIB_CHECK_VERSION(2,6,0)
 #include <glib/gstdio.h>
 #else
-#define g_chmod(path, mode) (chmod ((path), (mode)))
 #define g_lstat(path, buffer) (lstat ((path), (buffer)))
 #define g_mkdir(path, mode) (mkdir ((path), (mode)))
 #define g_remove(path) (remove ((path)))
 #define g_rename(oldfilename, newfilename) (rename ((oldfilename), (newfilename)))
 #endif
 
+#if !GLIB_CHECK_VERSION(2,7,2)
+#define g_chmod(path, mode) (chmod ((path), (mode)))
+#endif
 
 
 typedef struct _ThunarVfsTransferBase ThunarVfsTransferBase;