[dovecot-cvs] dovecot/src/lib module-dir.c,1.19.2.3,1.19.2.4

tss at dovecot.org tss at dovecot.org
Thu Dec 21 15:53:57 UTC 2006


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

Modified Files:
      Tag: branch_1_0
	module-dir.c 
Log Message:
If the module dir doesn't exist, die only if we were given a list of modules
to load. Otherwise fail silently.



Index: module-dir.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/module-dir.c,v
retrieving revision 1.19.2.3
retrieving revision 1.19.2.4
diff -u -d -r1.19.2.3 -r1.19.2.4
--- module-dir.c	21 Dec 2006 11:29:23 -0000	1.19.2.3
+++ module-dir.c	21 Dec 2006 15:53:55 -0000	1.19.2.4
@@ -190,8 +190,16 @@
 		i_info("Loading modules from directory: %s", dir);
 
 	dirp = opendir(dir);
-	if (dirp == NULL)
-		i_fatal("opendir(%s) failed: %m", dir);
+	if (dirp == NULL) {
+		if (module_names != NULL) {
+			/* we were given a list of modules to load.
+			   we can't fail. */
+			i_fatal("opendir(%s) failed: %m", dir);
+		}
+		if (errno != ENOENT)
+			i_error("opendir(%s) failed: %m", dir);
+		return NULL;
+	}
 
 	pool = pool_alloconly_create("module loader", 1024);
 	ARRAY_CREATE(&names, pool, const char *, 32);



More information about the dovecot-cvs mailing list