@@ -185,7 +185,7 @@ CWD_API int virtual_stat(const char *path, zend_stat_t *buf);
185185CWD_API int virtual_lstat (const char * path , zend_stat_t * buf );
186186CWD_API int virtual_unlink (const char * path );
187187CWD_API int virtual_mkdir (const char * pathname , mode_t mode );
188- CWD_API int virtual_rmdir (const char * pathname );
188+ CWD_API zend_result virtual_rmdir (const char * path , size_t path_len );
189189CWD_API DIR * virtual_opendir (const char * pathname );
190190CWD_API FILE * virtual_popen (const char * command , const char * type );
191191CWD_API int virtual_access (const char * pathname , int mode );
@@ -260,6 +260,10 @@ static zend_always_inline zend_result virtual_rename_native(const char *old_name
260260 return (rename (old_name , new_name ) == 0 ) ? SUCCESS : FAILURE ;
261261}
262262
263+ static zend_always_inline zend_result virtual_rmdir_native (const char * path , ZEND_ATTRIBUTE_UNUSED size_t path_len ) {
264+ return (rmdir (path ) == 0 ) ? SUCCESS : FAILURE ;
265+ }
266+
263267#ifdef CWD_EXPORTS
264268extern void virtual_cwd_main_cwd_init (uint8_t );
265269#endif
@@ -285,8 +289,8 @@ extern void virtual_cwd_main_cwd_init(uint8_t);
285289#define VCWD_STAT (path , buff ) virtual_stat(path, buff)
286290# define VCWD_LSTAT (path , buff ) virtual_lstat(path, buff)
287291#define VCWD_UNLINK (path ) virtual_unlink(path)
288- #define VCWD_MKDIR (pathname , mode ) virtual_mkdir(pathname , mode)
289- #define VCWD_RMDIR (pathname ) virtual_rmdir(pathname )
292+ #define VCWD_MKDIR (path , mode ) virtual_mkdir(path , mode)
293+ #define VCWD_RMDIR (path , path_len ) virtual_rmdir(path, path_len )
290294#define VCWD_OPENDIR (pathname ) virtual_opendir(pathname)
291295#define VCWD_POPEN (command , type ) virtual_popen(command, type)
292296#define VCWD_ACCESS (pathname , mode ) virtual_access(pathname, mode)
@@ -311,8 +315,8 @@ extern void virtual_cwd_main_cwd_init(uint8_t);
311315#define VCWD_OPEN (path , flags ) php_win32_ioutil_open(path, flags)
312316#define VCWD_OPEN_MODE (path , flags , mode ) php_win32_ioutil_open(path, flags, mode)
313317#define VCWD_RENAME (old_name , old_name_length , new_name , new_name_length ) php_win32_ioutil_rename(old_name, old_name_length, new_name, new_name_length)
314- #define VCWD_MKDIR (pathname , mode ) php_win32_ioutil_mkdir(pathname , mode)
315- #define VCWD_RMDIR (pathname ) php_win32_ioutil_rmdir(pathname )
318+ #define VCWD_MKDIR (path , mode ) php_win32_ioutil_mkdir(path , mode)
319+ #define VCWD_RMDIR (path , path_length ) php_win32_ioutil_rmdir(path, path_length )
316320#define VCWD_UNLINK (path ) php_win32_ioutil_unlink(path)
317321#define VCWD_CHDIR (path ) php_win32_ioutil_chdir(path)
318322#define VCWD_ACCESS (pathname , mode ) tsrm_win32_access(pathname, mode)
@@ -324,7 +328,7 @@ extern void virtual_cwd_main_cwd_init(uint8_t);
324328#define VCWD_OPEN_MODE (path , flags , mode ) open(path, flags, mode)
325329#define VCWD_RENAME (old_name , old_name_len , new_name , new_name_len ) virtual_rename_native(old_name, old_name_len, new_name, new_name_len)
326330#define VCWD_MKDIR (path , mode ) mkdir(path, mode)
327- #define VCWD_RMDIR (pathname ) rmdir(pathname )
331+ #define VCWD_RMDIR (path , path_len ) virtual_rmdir_native(path, path_len )
328332#define VCWD_UNLINK (path ) unlink(path)
329333#define VCWD_CHDIR (path ) chdir(path)
330334#define VCWD_ACCESS (pathname , mode ) access(pathname, mode)
0 commit comments