Skip to content

Commit 00c1e7b

Browse files
committed
Reserve less file space if possible in a directory entry
On POSIX systems, we can use the maximum file length instead of maximum path length. This saves space and time for clearing the memory.
1 parent 1fbbd2b commit 00c1e7b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

main/php_streams.h

+4
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@ typedef struct _php_stream_statbuf {
107107
} php_stream_statbuf;
108108

109109
typedef struct _php_stream_dirent {
110+
#ifdef NAME_MAX
111+
char d_name[NAME_MAX + 1];
112+
#else
110113
char d_name[MAXPATHLEN];
114+
#endif
111115
} php_stream_dirent;
112116

113117
/* operations on streams that are file-handles */

0 commit comments

Comments
 (0)