From http://en.znc.in/wiki/User:Psychon/ToDo, implement #10 -- "WritePidFile and DeletePidFile should use some common code to get the path for the pid file (copy & paste is evil :P) ".
Uhm, not going to commit this.
Here's a hint: When you call new, it usually makes sense to call delete later on.
And another hint: Don't code when tired, I usually write stupid bugs when I do that. ;)
Oh, also it could make sense to make InitPidFile() protected/private since it's not really meant to be used by others. But that's pretty much a matter of taste...