[dovecot-cvs] dovecot/src/lib mountpoint.c, 1.6, 1.7 mountpoint.h, 1.1, 1.2

tss at dovecot.org tss at dovecot.org
Wed Oct 11 11:33:23 UTC 2006


Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv9197

Modified Files:
	mountpoint.c mountpoint.h 
Log Message:
Handle ENOENT silently and return 0.



Index: mountpoint.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/mountpoint.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- mountpoint.c	1 Jul 2006 20:14:39 -0000	1.6
+++ mountpoint.c	11 Oct 2006 10:33:20 -0000	1.7
@@ -44,6 +44,9 @@
 
 	memset(point_r, 0, sizeof(*point_r));
 	if (statfs(path, &buf) < 0) {
+		if (errno == ENOENT)
+			return 0;
+
 		i_error("statfs(%s) failed: %m", path);
 		return -1;
 	}
@@ -67,6 +70,9 @@
 
 	memset(point_r, 0, sizeof(*point_r));
 	if (stat(path, &st) < 0) {
+		if (errno == ENOENT)
+			return 0;
+
 		i_error("stat(%s) failed: %m", path);
 		return -1;
 	}

Index: mountpoint.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/mountpoint.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- mountpoint.h	14 Apr 2006 10:26:55 -0000	1.1
+++ mountpoint.h	11 Oct 2006 10:33:20 -0000	1.2
@@ -8,7 +8,8 @@
 	unsigned int block_size;
 };
 
-/* Returns 1 = found, 0 = not found, -1 = error */
+/* Returns 1 = found, 0 = not found (from mount tabs, or the path itself),
+   -1 = error */
 int mountpoint_get(const char *path, pool_t pool, struct mountpoint *point_r);
 
 #endif



More information about the dovecot-cvs mailing list