Compare commits
	
		
			1 Commits
		
	
	
		
			example-ze
			...
			example-ze
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 49322894fa | 
| @@ -60,7 +60,7 @@ ZGetCharset(char *charset) | |||||||
|     if (!strcmp(charset, "NONE") || !strcmp(charset, "UNKNOWN")) |     if (!strcmp(charset, "NONE") || !strcmp(charset, "UNKNOWN")) | ||||||
| 	retval = ZCHARSET_UNKNOWN; | 	retval = ZCHARSET_UNKNOWN; | ||||||
|     else if (!strcmp(charset, "ANSI_X3.4-1968")) |     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")) |     else if (!strcmp(charset, "ISO-8859-1")) | ||||||
| 	retval = ZCHARSET_ISO_8859_1; | 	retval = ZCHARSET_ISO_8859_1; | ||||||
|     else if (!strcmp(charset, "UTF-8")) |     else if (!strcmp(charset, "UTF-8")) | ||||||
|   | |||||||
							
								
								
									
										25
									
								
								zhm/zhm.c
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								zhm/zhm.c
									
									
									
									
									
								
							| @@ -412,14 +412,16 @@ init_hm(void) | |||||||
|      serv_sin.sin_port = (sp) ? sp->s_port : SERVER_SVC_FALLBACK; |      serv_sin.sin_port = (sp) ? sp->s_port : SERVER_SVC_FALLBACK; | ||||||
|  |  | ||||||
| #ifndef DEBUG | #ifndef DEBUG | ||||||
|      if (!inetd && !nofork) |      if (!inetd && !nofork) { | ||||||
| 	 detach(); | 	 detach(); | ||||||
|  |      } | ||||||
|      /* Write pid to file */ |      else { | ||||||
|      fp = fopen(PidFile, "w"); |        /* Write pid to file */ | ||||||
|      if (fp != NULL) { |        fp = fopen(PidFile, "w"); | ||||||
| 	 fprintf(fp, "%d\n", getpid()); |        if (fp != NULL) { | ||||||
| 	 fclose(fp); | 	   fprintf(fp, "%d\n", getpid()); | ||||||
|  | 	   fclose(fp); | ||||||
|  |        } | ||||||
|      } |      } | ||||||
| #endif /* DEBUG */ | #endif /* DEBUG */ | ||||||
|  |  | ||||||
| @@ -469,11 +471,18 @@ detach(void) | |||||||
|      /* detach from terminal and fork. */ |      /* detach from terminal and fork. */ | ||||||
|      register int i, x = ZGetFD(); |      register int i, x = ZGetFD(); | ||||||
|      register long size; |      register long size; | ||||||
|  |      FILE *fp; | ||||||
|  |  | ||||||
|      i = fork(); |      i = fork(); | ||||||
|      if (i) { |      if (i) { | ||||||
| 	  if (i < 0) | 	  if (i < 0) { | ||||||
| 	       perror("fork"); | 	       perror("fork"); | ||||||
|  | 	  } | ||||||
|  | 	  fp = fopen(PidFile, "w"); | ||||||
|  | 	  if (fp != NULL) { | ||||||
|  | 	  	fprintf(fp, "%d\n", i); | ||||||
|  | 	  	fclose(fp); | ||||||
|  | 	  } | ||||||
| 	  exit(0); | 	  exit(0); | ||||||
|      } |      } | ||||||
| #ifdef _POSIX_VERSION | #ifdef _POSIX_VERSION | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user