Commit Diff


commit - 04169f34cf23d382c8a420107309daea2b52d999
commit + c06c815c2806947dd37d5ba78e7c5dc2339c9db4
blob - 674767769a77e8021610b65618f3632136d2f8e9
blob + 48e041bda2189202e68194c0f55889dda2bad4ef
--- src/ngircd/ngircd.c
+++ src/ngircd/ngircd.c
@@ -12,7 +12,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: ngircd.c,v 1.98 2005/06/17 20:35:45 fw Exp $";
+static char UNUSED id[] = "$Id: ngircd.c,v 1.99 2005/06/17 23:13:41 fw Exp $";
 
 /**
  * @file
@@ -789,12 +789,14 @@ NGIRCd_Init( bool NGIRCd_NoDaemon ) 
 	/* Change working directory to home directory of the user
 	 * we are running as (only when running in daemon mode and not in chroot) */
 	
-	if ( pwd && !NGIRCd_NoDaemon ) {
-		if( chdir( pwd->pw_dir ) == 0 ) 
-			Log( LOG_DEBUG, "Changed working directory to \"%s\" ...", pwd->pw_dir );
-		else 
-			Log( LOG_ERR, "Can't change working directory to \"%s\": %s",
-							pwd->pw_dir, strerror( errno ));
+	if ( pwd ) {
+		if (!NGIRCd_NoDaemon ) {
+			if( chdir( pwd->pw_dir ) == 0 ) 
+				Log( LOG_DEBUG, "Changed working directory to \"%s\" ...", pwd->pw_dir );
+			else 
+				Log( LOG_ERR, "Can't change working directory to \"%s\": %s",
+								pwd->pw_dir, strerror( errno ));
+
 	} else {
 		Log( LOG_ERR, "Can't get user informaton for UID %d!?", Conf_UID );
 	}