diff --git a/lib/charset.c b/lib/charset.c index 14aec28..4d261b9 100644 --- a/lib/charset.c +++ b/lib/charset.c @@ -60,7 +60,7 @@ ZGetCharset(char *charset) if (!strcmp(charset, "NONE") || !strcmp(charset, "UNKNOWN")) retval = ZCHARSET_UNKNOWN; else if (!strcmp(charset, "ANSI_X3.4-1968")) - retval = ZCHARSET_ISO_8859_1; /* A hack. */ + retval = ZCHARSET_UTF_8; /* A hack. */ else if (!strcmp(charset, "ISO-8859-1")) retval = ZCHARSET_ISO_8859_1; else if (!strcmp(charset, "UTF-8")) diff --git a/zhm/zhm.c b/zhm/zhm.c index ec4696b..9a5b133 100644 --- a/zhm/zhm.c +++ b/zhm/zhm.c @@ -412,14 +412,16 @@ init_hm(void) serv_sin.sin_port = (sp) ? sp->s_port : SERVER_SVC_FALLBACK; #ifndef DEBUG - if (!inetd && !nofork) + if (!inetd && !nofork) { detach(); - - /* Write pid to file */ - fp = fopen(PidFile, "w"); - if (fp != NULL) { - fprintf(fp, "%d\n", getpid()); - fclose(fp); + } + else { + /* Write pid to file */ + fp = fopen(PidFile, "w"); + if (fp != NULL) { + fprintf(fp, "%d\n", getpid()); + fclose(fp); + } } #endif /* DEBUG */ @@ -469,11 +471,18 @@ detach(void) /* detach from terminal and fork. */ register int i, x = ZGetFD(); register long size; + FILE *fp; i = fork(); if (i) { - if (i < 0) + if (i < 0) { perror("fork"); + } + fp = fopen(PidFile, "w"); + if (fp != NULL) { + fprintf(fp, "%d\n", i); + fclose(fp); + } exit(0); } #ifdef _POSIX_VERSION