Skip to content

Commit f52655e

Browse files
committedJul 1, 2015
Fixed include for Linux.
1 parent e5769d6 commit f52655e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

‎vm/util/logger.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include <fcntl.h>
1010
#include <string.h>
1111
#include <time.h>
12+
#include <sys/param.h>
1213
#include <sys/stat.h>
13-
#include <sys/syslimits.h>
1414

1515
#include <zlib.h>
1616

@@ -322,22 +322,22 @@ namespace rubinius {
322322
void* buf = malloc(LOGGER_MAX_COPY_BUF);
323323
if(!buf) return;
324324

325-
char* from = (char*)malloc(PATH_MAX);
325+
char* from = (char*)malloc(MAXPATHLEN);
326326
if(!from) return;
327327

328-
char* to = (char*)malloc(PATH_MAX);
328+
char* to = (char*)malloc(MAXPATHLEN);
329329
if(!to) return;
330330

331331
for(int i = archives_; i > 0; i--) {
332332
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);
334334
} else {
335-
snprintf(from, PATH_MAX, "%s", path_.c_str());
335+
snprintf(from, MAXPATHLEN, "%s", path_.c_str());
336336
}
337337

338338
if(stat(from, &st) || !S_ISREG(st.st_mode)) continue;
339339

340-
snprintf(to, PATH_MAX, "%s.%d.Z", path_.c_str(), i);
340+
snprintf(to, MAXPATHLEN, "%s.%d.Z", path_.c_str(), i);
341341

342342
int from_fd = ::open(from, LOGGER_FROM_FLAGS, LOGGER_OPEN_PERMS);
343343
if(from_fd < 0) continue;

0 commit comments

Comments
 (0)
Please sign in to comment.