|
9 | 9 | #include <fcntl.h>
|
10 | 10 | #include <string.h>
|
11 | 11 | #include <time.h>
|
| 12 | +#include <sys/param.h> |
12 | 13 | #include <sys/stat.h>
|
13 |
| -#include <sys/syslimits.h> |
14 | 14 |
|
15 | 15 | #include <zlib.h>
|
16 | 16 |
|
@@ -322,22 +322,22 @@ namespace rubinius {
|
322 | 322 | void* buf = malloc(LOGGER_MAX_COPY_BUF);
|
323 | 323 | if(!buf) return;
|
324 | 324 |
|
325 |
| - char* from = (char*)malloc(PATH_MAX); |
| 325 | + char* from = (char*)malloc(MAXPATHLEN); |
326 | 326 | if(!from) return;
|
327 | 327 |
|
328 |
| - char* to = (char*)malloc(PATH_MAX); |
| 328 | + char* to = (char*)malloc(MAXPATHLEN); |
329 | 329 | if(!to) return;
|
330 | 330 |
|
331 | 331 | for(int i = archives_; i > 0; i--) {
|
332 | 332 | if(i > 1) {
|
333 |
| - snprintf(from, PATH_MAX, "%s.%d.Z", path_.c_str(), i - 1); |
| 333 | + snprintf(from, MAXPATHLEN, "%s.%d.Z", path_.c_str(), i - 1); |
334 | 334 | } else {
|
335 |
| - snprintf(from, PATH_MAX, "%s", path_.c_str()); |
| 335 | + snprintf(from, MAXPATHLEN, "%s", path_.c_str()); |
336 | 336 | }
|
337 | 337 |
|
338 | 338 | if(stat(from, &st) || !S_ISREG(st.st_mode)) continue;
|
339 | 339 |
|
340 |
| - snprintf(to, PATH_MAX, "%s.%d.Z", path_.c_str(), i); |
| 340 | + snprintf(to, MAXPATHLEN, "%s.%d.Z", path_.c_str(), i); |
341 | 341 |
|
342 | 342 | int from_fd = ::open(from, LOGGER_FROM_FLAGS, LOGGER_OPEN_PERMS);
|
343 | 343 | if(from_fd < 0) continue;
|
|
0 commit comments