Mercurial > hg > nginx
view src/os/unix/ngx_errno.c @ 457:ded1284520cc release-0.1.3
nginx-0.1.3-RELEASE import
*) Feature: the ngx_http_autoindex_module and the autoindex directive.
*) Feature: the proxy_set_x_url directive.
*) Bugfix: proxy module may get caught in an endless loop when sendfile
is not used.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 25 Oct 2004 15:29:23 +0000 |
parents | 23fb87bddda1 |
children | a88a3e4e158f |
line wrap: on
line source
/* * Copyright (C) Igor Sysoev */ #include <ngx_config.h> #include <ngx_core.h> #if (NGX_STRERROR_R) ngx_int_t ngx_strerror_r(int err, char *errstr, size_t size) { size_t len; if (size == 0) { return 0; } errstr[0] = '\0'; strerror_r(err, errstr, size); for (len = 0; len < size; len++) { if (errstr[len] == '\0') { break; } } return len; } #elif (NGX_GNU_STRERROR_R) /* Linux strerror_r() */ ngx_int_t ngx_strerror_r(int err, char *errstr, size_t size) { char *str; size_t len; if (size == 0) { return 0; } errstr[0] = '\0'; str = strerror_r(err, errstr, size); if (str != errstr) { return ngx_cpystrn((u_char *) errstr, (u_char *) str, size) - (u_char *) errstr; } for (len = 0; len < size; len++) { if (errstr[len] == '\0') { break; } } return len; } #endif