Index: gio/gunixmounts.c
===================================================================
--- gio/gunixmounts.c	(revision 6300)
+++ gio/gunixmounts.c	(working copy)
@@ -1191,7 +1191,7 @@
   if (get_fstab_file () != NULL)
     {
       file = g_file_new_for_path (get_fstab_file ());
-      monitor->fstab_monitor = g_file_monitor_file (file, 0, NULL);
+      monitor->fstab_monitor = g_file_monitor_file (file, 0, NULL, NULL);
       g_object_unref (file);
       
       g_signal_connect (monitor->fstab_monitor, "changed", (GCallback)fstab_file_changed, monitor);
@@ -1200,7 +1200,7 @@
   if (get_mtab_monitor_file () != NULL)
     {
       file = g_file_new_for_path (get_mtab_monitor_file ());
-      monitor->mtab_monitor = g_file_monitor_file (file, 0, NULL);
+      monitor->mtab_monitor = g_file_monitor_file (file, 0, NULL, NULL);
       g_object_unref (file);
       
       g_signal_connect (monitor->mtab_monitor, "changed", (GCallback)mtab_file_changed, monitor);
Index: gio/glocaldirectorymonitor.c
===================================================================
--- gio/glocaldirectorymonitor.c	(revision 6300)
+++ gio/glocaldirectorymonitor.c	(working copy)
@@ -276,8 +276,9 @@
  * Returns: new #GFileMonitor for the given @dirname.
  **/
 GFileMonitor*
-_g_local_directory_monitor_new (const char*       dirname,
-				GFileMonitorFlags flags)
+_g_local_directory_monitor_new (const char         *dirname,
+				GFileMonitorFlags   flags,
+				GError            **error)
 {
   static GOnce once_init = G_ONCE_INIT;
   GTypeClass *type_class;
@@ -291,6 +292,8 @@
   monitor = NULL;
   if (type != G_TYPE_INVALID)
     monitor = G_FILE_MONITOR (g_object_new (type, "dirname", dirname, NULL));
+  else
+    g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Unable to find default local directory monitor type"));
 
   /* This is non-null on first pass here. Unref the class now.
    * This is to avoid unloading the module and then loading it
Index: gio/glocaldirectorymonitor.h
===================================================================
--- gio/glocaldirectorymonitor.h	(revision 6300)
+++ gio/glocaldirectorymonitor.h	(working copy)
@@ -59,7 +59,8 @@
 GType g_local_directory_monitor_get_type (void) G_GNUC_CONST;
 
 GFileMonitor* _g_local_directory_monitor_new (const char* dirname,
-					      GFileMonitorFlags flags);
+					      GFileMonitorFlags flags,
+					      GError **error);
 
 G_END_DECLS
 
Index: gio/gfile.c
===================================================================
--- gio/gfile.c	(revision 6300)
+++ gio/gfile.c	(working copy)
@@ -3249,6 +3249,7 @@
  * @file: input #GFile.
  * @flags: a set of #GFileMonitorFlags.
  * @cancellable: optional #GCancellable object, %NULL to ignore.
+ * @error: a #GError, or %NULL.
  * 
  * Obtains a directory monitor for the given file.
  * This may fail if directory monitoring is not supported.
@@ -3263,18 +3264,27 @@
 GFileMonitor*
 g_file_monitor_directory (GFile             *file,
 			  GFileMonitorFlags  flags,
-			  GCancellable      *cancellable)
+			  GCancellable      *cancellable,
+			  GError           **error)
 {
   GFileIface *iface;
 
   g_return_val_if_fail (G_IS_FILE (file), NULL);
 
+  if (g_cancellable_set_error_if_cancelled (cancellable, error))
+    return NULL;
+
   iface = G_FILE_GET_IFACE (file);
 
   if (iface->monitor_dir == NULL)
-    return NULL;
+    {
+      g_set_error (error, G_IO_ERROR,
+		   G_IO_ERROR_NOT_SUPPORTED,
+		   _("Operation not supported"));
+      return NULL;
+    }
 
-  return (* iface->monitor_dir) (file, flags, cancellable);
+  return (* iface->monitor_dir) (file, flags, cancellable, error);
 }
 
 /**
@@ -3282,6 +3292,7 @@
  * @file: input #GFile.
  * @flags: a set of #GFileMonitorFlags.
  * @cancellable: optional #GCancellable object, %NULL to ignore.
+ * @error: a #GError, or %NULL.
  * 
  * Obtains a file monitor for the given file. If no file notification
  * mechanism exists, then regular polling of the file is used.
@@ -3295,19 +3306,23 @@
 GFileMonitor*
 g_file_monitor_file (GFile             *file,
 		     GFileMonitorFlags  flags,
-		     GCancellable      *cancellable)
+		     GCancellable      *cancellable,
+		     GError           **error)
 {
   GFileIface *iface;
   GFileMonitor *monitor;
   
   g_return_val_if_fail (G_IS_FILE (file), NULL);
 
+  if (g_cancellable_set_error_if_cancelled (cancellable, error))
+    return NULL;
+
   iface = G_FILE_GET_IFACE (file);
 
   monitor = NULL;
   
   if (iface->monitor_file)
-    monitor = (* iface->monitor_file) (file, flags, cancellable);
+    monitor = (* iface->monitor_file) (file, flags, cancellable, error);
 
 /* Fallback to polling */
   if (monitor == NULL)
Index: gio/gfile.h
===================================================================
--- gio/gfile.h	(revision 6300)
+++ gio/gfile.h	(working copy)
@@ -518,11 +518,13 @@
   
   GFileMonitor*      (*monitor_dir)         (GFile                  *file,
 					     GFileMonitorFlags       flags,
-					     GCancellable           *cancellable);
+					     GCancellable           *cancellable,
+					     GError                **error);
 
   GFileMonitor*      (*monitor_file)        (GFile                  *file,
 					     GFileMonitorFlags       flags,
-					     GCancellable           *cancellable);
+					     GCancellable           *cancellable,
+					     GError                **error);
 
 };
 
@@ -794,10 +796,12 @@
 
 GFileMonitor*           g_file_monitor_directory          (GFile                  *file,
 							   GFileMonitorFlags       flags,
-							   GCancellable           *cancellable);
+							   GCancellable           *cancellable,
+							   GError                **error);
 GFileMonitor*           g_file_monitor_file               (GFile                  *file,
 							   GFileMonitorFlags       flags,
-							   GCancellable           *cancellable);
+							   GCancellable           *cancellable,
+							   GError                **error);
 
 
 /* Utilities */
Index: gio/glocalfile.c
===================================================================
--- gio/glocalfile.c	(revision 6300)
+++ gio/glocalfile.c	(working copy)
@@ -1854,19 +1854,21 @@
 static GFileMonitor*
 g_local_file_monitor_dir (GFile             *file,
 			  GFileMonitorFlags  flags,
-			  GCancellable      *cancellable)
+			  GCancellable      *cancellable,
+			  GError           **error)
 {
   GLocalFile* local_file = G_LOCAL_FILE(file);
-  return _g_local_directory_monitor_new (local_file->filename, flags);
+  return _g_local_directory_monitor_new (local_file->filename, flags, error);
 }
 
 static GFileMonitor*
 g_local_file_monitor_file (GFile             *file,
 			   GFileMonitorFlags  flags,
-			   GCancellable      *cancellable)
+			   GCancellable      *cancellable,
+			   GError           **error)
 {
   GLocalFile* local_file = G_LOCAL_FILE(file);
-  return _g_local_file_monitor_new (local_file->filename, flags);
+  return _g_local_file_monitor_new (local_file->filename, flags, error);
 }
 
 static void
Index: gio/glocalfilemonitor.c
===================================================================
--- gio/glocalfilemonitor.c	(revision 6300)
+++ gio/glocalfilemonitor.c	(working copy)
@@ -205,8 +205,9 @@
  * Returns: a new #GFileMonitor for the given @pathname. 
  **/
 GFileMonitor*
-_g_local_file_monitor_new (const char        *pathname,
-			   GFileMonitorFlags  flags)
+_g_local_file_monitor_new (const char         *pathname,
+			   GFileMonitorFlags   flags,
+			   GError            **error)
 {
   static GOnce once_init = G_ONCE_INIT;
   GTypeClass *type_class;
@@ -220,6 +221,8 @@
   monitor = NULL;
   if (type != G_TYPE_INVALID)
     monitor = G_FILE_MONITOR (g_object_new (type, "filename", pathname, NULL));
+  else
+    g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Unable to find default local file monitor type"));
 
   /* This is non-null on first pass here. Unref the class now.
    * This is to avoid unloading the module and then loading it
Index: gio/glocalfilemonitor.h
===================================================================
--- gio/glocalfilemonitor.h	(revision 6300)
+++ gio/glocalfilemonitor.h	(working copy)
@@ -53,7 +53,8 @@
 GType g_local_file_monitor_get_type (void) G_GNUC_CONST;
 
 GFileMonitor* _g_local_file_monitor_new (const char* pathname,
-					 GFileMonitorFlags flags);
+					 GFileMonitorFlags flags,
+					 GError **error);
 
 G_END_DECLS
 
