compat/win32/syslog.c: use warning_errno()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
							parent
							
								
									4b94ec9b20
								
							
						
					
					
						commit
						df8e31391d
					
				|  | @ -28,13 +28,13 @@ void syslog(int priority, const char *fmt, ...) | ||||||
| 	va_end(ap); | 	va_end(ap); | ||||||
|  |  | ||||||
| 	if (str_len < 0) { | 	if (str_len < 0) { | ||||||
| 		warning("vsnprintf failed: '%s'", strerror(errno)); | 		warning_errno("vsnprintf failed"); | ||||||
| 		return; | 		return; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	str = malloc(st_add(str_len, 1)); | 	str = malloc(st_add(str_len, 1)); | ||||||
| 	if (!str) { | 	if (!str) { | ||||||
| 		warning("malloc failed: '%s'", strerror(errno)); | 		warning_errno("malloc failed"); | ||||||
| 		return; | 		return; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | @ -45,7 +45,7 @@ void syslog(int priority, const char *fmt, ...) | ||||||
| 	while ((pos = strstr(str, "%1")) != NULL) { | 	while ((pos = strstr(str, "%1")) != NULL) { | ||||||
| 		str = realloc(str, st_add(++str_len, 1)); | 		str = realloc(str, st_add(++str_len, 1)); | ||||||
| 		if (!str) { | 		if (!str) { | ||||||
| 			warning("realloc failed: '%s'", strerror(errno)); | 			warning_errno("realloc failed"); | ||||||
| 			return; | 			return; | ||||||
| 		} | 		} | ||||||
| 		memmove(pos + 2, pos + 1, strlen(pos)); | 		memmove(pos + 2, pos + 1, strlen(pos)); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Nguyễn Thái Ngọc Duy
						Nguyễn Thái Ngọc Duy