Mercurial > hg > nginx
comparison src/core/ngx_conf_file.c @ 2765:6d358aeaa989
ngx_log_errno()
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 27 Apr 2009 13:17:33 +0000 |
parents | d4a717592877 |
children | 9b107cdf53f6 |
comparison
equal
deleted
inserted
replaced
2764:d4a717592877 | 2765:6d358aeaa989 |
---|---|
963 va_start(args, fmt); | 963 va_start(args, fmt); |
964 p = ngx_vslprintf(errstr, last, fmt, args); | 964 p = ngx_vslprintf(errstr, last, fmt, args); |
965 va_end(args); | 965 va_end(args); |
966 | 966 |
967 if (err) { | 967 if (err) { |
968 | 968 p = ngx_log_errno(p, last, err); |
969 if (p > last - 50) { | |
970 | |
971 /* leave a space for an error code */ | |
972 | |
973 p = last - 50; | |
974 *p++ = '.'; | |
975 *p++ = '.'; | |
976 *p++ = '.'; | |
977 } | |
978 | |
979 #if (NGX_WIN32) | |
980 p = ngx_slprintf(p, last, ((unsigned) err < 0x80000000) | |
981 ? " (%d: " : " (%Xd: ", err); | |
982 #else | |
983 p = ngx_slprintf(p, last, " (%d: ", err); | |
984 #endif | |
985 | |
986 p = ngx_strerror_r(err, p, last - p); | |
987 | |
988 *p++ = ')'; | |
989 } | 969 } |
990 | 970 |
991 if (cf->conf_file == NULL) { | 971 if (cf->conf_file == NULL) { |
992 ngx_log_error(level, cf->log, 0, "%*s", p - errstr, errstr); | 972 ngx_log_error(level, cf->log, 0, "%*s", p - errstr, errstr); |
993 return; | 973 return; |