[dovecot-cvs] dovecot/src/lib mountpoint.c, 1.4.2.2, 1.4.2.3 mountpoint.h, 1.1, 1.1.2.1

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


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

Modified Files:
      Tag: branch_1_0
	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.4.2.2
retrieving revision 1.4.2.3
diff -u -d -r1.4.2.2 -r1.4.2.3
--- mountpoint.c	1 Jul 2006 20:14:37 -0000	1.4.2.2
+++ mountpoint.c	11 Oct 2006 10:33:18 -0000	1.4.2.3
@@ -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.1.2.1
diff -u -d -r1.1 -r1.1.2.1
--- mountpoint.h	14 Apr 2006 10:26:55 -0000	1.1
+++ mountpoint.h	11 Oct 2006 10:33:18 -0000	1.1.2.1
@@ -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