]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/ngircd.c
Always cloak client hostname, if needed
[ngircd-alex.git] / src / ngircd / ngircd.c
index 60d15a1f8a7be1afe807d192f52223e4dffac50a..8a93bcb00839a796b262b890d12b373d662ccf56 100644 (file)
@@ -498,7 +498,8 @@ Pidfile_Create(pid_t pid)
 
        len = snprintf(pidbuf, sizeof pidbuf, "%ld\n", (long)pid);
        if (len < 0 || len >= (int)sizeof pidbuf) {
-               Log( LOG_ERR, "Error converting pid");
+               Log(LOG_ERR, "Error converting pid");
+               close(pidfd);
                return;
        }
        
@@ -642,12 +643,10 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
                }
 
                if (chroot(Conf_Chroot) != 0) {
-                       if (errno != EPERM) {
-                               Log(LOG_ERR,
-                                   "Can't change root directory to \"%s\": %s",
-                                   Conf_Chroot, strerror(errno));
-                               goto out;
-                       }
+                       Log(LOG_ERR,
+                           "Can't change root directory to \"%s\": %s",
+                           Conf_Chroot, strerror(errno));
+                       goto out;
                } else {
                        chrooted = true;
                        Log(LOG_INFO,