Mercurial > hg > nginx
comparison src/os/unix/ngx_files.h @ 4558:8865fd1f3aa5
Fixed unconditional MAX_PATH usage (ticket #22).
POSIX doesn't require it to be defined, and Debian GNU/Hurd doesn't define
it. Note that if there is no MAX_PATH defined we have to use realpath()
with NULL argument and free() the result.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 27 Mar 2012 16:42:34 +0000 |
parents | 569ea17767bf |
children | 626f288fa5ed |
comparison
equal
deleted
inserted
replaced
4557:b13419459a50 | 4558:8865fd1f3aa5 |
---|---|
198 #define ngx_filename_cmp ngx_memcmp | 198 #define ngx_filename_cmp ngx_memcmp |
199 | 199 |
200 #endif | 200 #endif |
201 | 201 |
202 | 202 |
203 #define ngx_realpath(p, r) realpath((char *) p, (char *) r) | 203 #define ngx_realpath(p, r) (u_char *) realpath((char *) p, (char *) r) |
204 #define ngx_realpath_n "realpath()" | 204 #define ngx_realpath_n "realpath()" |
205 #define ngx_getcwd(buf, size) (getcwd((char *) buf, size) != NULL) | 205 #define ngx_getcwd(buf, size) (getcwd((char *) buf, size) != NULL) |
206 #define ngx_getcwd_n "getcwd()" | 206 #define ngx_getcwd_n "getcwd()" |
207 #define ngx_path_separator(c) ((c) == '/') | 207 #define ngx_path_separator(c) ((c) == '/') |
208 | 208 |
209 | |
210 #if defined(PATH_MAX) | |
211 | |
212 #define NGX_HAVE_MAX_PATH 1 | |
209 #define NGX_MAX_PATH PATH_MAX | 213 #define NGX_MAX_PATH PATH_MAX |
214 | |
215 #else | |
216 | |
217 #define NGX_MAX_PATH 4096 | |
218 | |
219 #endif | |
220 | |
210 | 221 |
211 #define NGX_DIR_MASK_LEN 0 | 222 #define NGX_DIR_MASK_LEN 0 |
212 | 223 |
213 | 224 |
214 ngx_int_t ngx_open_dir(ngx_str_t *name, ngx_dir_t *dir); | 225 ngx_int_t ngx_open_dir(ngx_str_t *name, ngx_dir_t *dir); |