Commit Diff


commit - 562d28f366cac1075071ff6c285011ae142a465e
commit + b3d7d68a5774cdeaee482d4befa3ff6f5c2ead59
blob - a0f5ad2fff0198ca581319b5ab0db5d295605398
blob + 8cc43d114839f4fde55099381fc205369a9b552e
--- main.c
+++ main.c
@@ -138,7 +138,7 @@ struct tcps {
 } *tn1, *tn2, *tnp;
 
 
-static const char rcsid[] = "$Id: main.c,v 1.72 2012/06/11 20:36:28 pbug Exp $";
+static const char rcsid[] = "$Id: main.c,v 1.73 2012/06/21 08:45:51 pbug Exp $";
 
 /* 
  * MAIN - set up arguments, set up database, set up sockets, call mainloop
@@ -291,6 +291,12 @@ main(int argc, char *argv[])
 	}
 
 	key = ftok("/usr/local/sbin/wildcarddnsd", 1);
+	if (key == (key_t)-1) {
+		syslog>(LOG_INFO, "ftok failed, does /usr/local/sbin/wildcarddnsd exist?");
+		slave_shutdown();
+		exit(1);
+	}
+		
 
 	if ((ret = dbenv->set_shm_key(dbenv, key)) != 0) {
 		syslog(LOG_INFO, "dbenv->set_shm_key failed");