Mercurial > dovecot > original-hg > dovecot-1.2
changeset 8065:c832be51c7ac HEAD
hostpid_init(): If called again, update the hostname/pid.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 04 Aug 2008 15:49:40 -0400 |
parents | 02c6ce8d4fef |
children | 28b1c4f68c9f |
files | src/lib/hostpid.c |
diffstat | 1 files changed, 6 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/hostpid.c Mon Aug 04 15:48:18 2008 -0400 +++ b/src/lib/hostpid.c Mon Aug 04 15:49:40 2008 -0400 @@ -12,16 +12,11 @@ { static char hostname[256], pid[MAX_INT_STRLEN]; - if (my_hostname == NULL) { - if (gethostname(hostname, sizeof(hostname)-1) == -1) - i_strocpy(hostname, "unknown", sizeof(hostname)); - hostname[sizeof(hostname)-1] = '\0'; + if (gethostname(hostname, sizeof(hostname)-1) == -1) + i_strocpy(hostname, "unknown", sizeof(hostname)); + hostname[sizeof(hostname)-1] = '\0'; + my_hostname = hostname; - my_hostname = hostname; - } - - if (my_pid == NULL) { - i_strocpy(pid, dec2str(getpid()), sizeof(pid)); - my_pid = pid; - } + i_strocpy(pid, dec2str(getpid()), sizeof(pid)); + my_pid = pid; }