mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
- In PHP we're supposed to only use MAXPATHLEN (defined in php.h)
This commit is contained in:
parent
86a1cace27
commit
8518010945
@ -44,13 +44,9 @@
|
||||
#define DBM_DATA dba_dbm_data *dba = info->dbf
|
||||
#define DBM_GKEY datum gkey; gkey.dptr = (char *) key; gkey.dsize = keylen
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 255
|
||||
#endif
|
||||
|
||||
#define TRUNC_IT(extension, mode) \
|
||||
snprintf(buf, PATH_MAX, "%s" extension, info->path); \
|
||||
buf[PATH_MAX] = '\0'; \
|
||||
snprintf(buf, MAXPATHLEN, "%s" extension, info->path); \
|
||||
buf[MAXPATHLEN-1] = '\0'; \
|
||||
if((fd = V_OPEN((buf, O_CREAT | mode | O_WRONLY, filemode))) == -1) \
|
||||
return FAILURE; \
|
||||
close(fd);
|
||||
@ -71,7 +67,7 @@ DBA_OPEN_FUNC(dbm)
|
||||
}
|
||||
|
||||
if(info->mode == DBA_TRUNC) {
|
||||
char buf[PATH_MAX + 1];
|
||||
char buf[MAXPATHLEN];
|
||||
|
||||
/* dbm/ndbm original */
|
||||
TRUNC_IT(".pag", O_TRUNC);
|
||||
@ -79,7 +75,7 @@ DBA_OPEN_FUNC(dbm)
|
||||
}
|
||||
|
||||
if(info->mode == DBA_CREAT) {
|
||||
char buf[PATH_MAX + 1];
|
||||
char buf[MAXPATHLEN];
|
||||
|
||||
TRUNC_IT(".pag", 0);
|
||||
TRUNC_IT(".dir", 0);
|
||||
|
Loading…
Reference in New Issue
Block a user