Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
54a9c0fc
Commit
54a9c0fc
authored
Jun 02, 2012
by
André Hentschel
Committed by
Alexandre Julliard
Jun 04, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add a helper function that returns the record length of a dirent struct.
parent
eaab7a88
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
5 deletions
+37
-5
configure
configure
+14
-0
configure.ac
configure.ac
+6
-0
directory.c
dlls/ntdll/directory.c
+14
-5
config.h.in
include/config.h.in
+3
-0
No files found.
configure
View file @
54a9c0fc
...
...
@@ -13794,6 +13794,20 @@ _ACEOF
fi
ac_fn_c_check_member
"
$LINENO
"
"struct dirent"
"d_reclen"
"ac_cv_member_struct_dirent_d_reclen"
"#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
"
if
test
"x
$ac_cv_member_struct_dirent_d_reclen
"
=
xyes
;
then
:
cat
>>
confdefs.h
<<
_ACEOF
#define HAVE_STRUCT_DIRENT_D_RECLEN 1
_ACEOF
fi
ac_fn_c_check_member
"
$LINENO
"
"struct msghdr"
"msg_accrights"
"ac_cv_member_struct_msghdr_msg_accrights"
"#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
...
...
configure.ac
View file @
54a9c0fc
...
...
@@ -2219,6 +2219,12 @@ AC_CHECK_MEMBERS([struct statvfs.f_blocks],,,
#include <sys/statvfs.h>
#endif])
dnl Check for dirent.d_reclen
AC_CHECK_MEMBERS([struct dirent.d_reclen],,,
[#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif])
dnl Check for socket structure members
AC_CHECK_MEMBERS([struct msghdr.msg_accrights, struct sockaddr.sa_len, struct sockaddr_un.sun_len],,,
[#include <sys/types.h>
...
...
dlls/ntdll/directory.c
View file @
54a9c0fc
...
...
@@ -1709,6 +1709,15 @@ static inline int wine_getdirentries(int fd, char *buf, int nbytes, long *basep)
return
res
;
}
static
inline
int
dir_reclen
(
struct
dirent
*
de
)
{
#ifdef HAVE_STRUCT_DIRENT_D_RECLEN
return
de
->
d_reclen
;
#else
return
_DIRENT_RECLEN
(
de
->
d_namlen
);
#endif
}
/***********************************************************************
* read_directory_getdirentries
*
...
...
@@ -1754,9 +1763,9 @@ static int read_directory_getdirentries( int fd, IO_STATUS_BLOCK *io, void *buff
/* check if we got . and .. from getdirentries */
if
(
res
>
0
)
{
if
(
!
strcmp
(
de
->
d_name
,
"."
)
&&
res
>
d
e
->
d_reclen
)
if
(
!
strcmp
(
de
->
d_name
,
"."
)
&&
res
>
d
ir_reclen
(
de
)
)
{
struct
dirent
*
next_de
=
(
struct
dirent
*
)(
data
+
d
e
->
d_reclen
);
struct
dirent
*
next_de
=
(
struct
dirent
*
)(
data
+
d
ir_reclen
(
de
)
);
if
(
!
strcmp
(
next_de
->
d_name
,
".."
))
fake_dot_dot
=
0
;
}
}
...
...
@@ -1792,7 +1801,7 @@ static int read_directory_getdirentries( int fd, IO_STATUS_BLOCK *io, void *buff
while
(
res
>
0
)
{
res
-=
d
e
->
d_reclen
;
res
-=
d
ir_reclen
(
de
)
;
if
(
de
->
d_fileno
&&
!
(
fake_dot_dot
&&
(
!
strcmp
(
de
->
d_name
,
"."
)
||
!
strcmp
(
de
->
d_name
,
".."
)))
&&
((
info
=
append_entry
(
buffer
,
io
,
length
,
de
->
d_name
,
NULL
,
mask
,
class
))))
...
...
@@ -1819,7 +1828,7 @@ static int read_directory_getdirentries( int fd, IO_STATUS_BLOCK *io, void *buff
if
(
res
>
0
&&
(
single_entry
||
io
->
Information
+
max_dir_info_size
(
class
)
>
length
))
{
lseek
(
fd
,
(
unsigned
long
)
restart_pos
,
SEEK_SET
);
size
=
(
char
*
)
de
+
d
e
->
d_reclen
-
data
;
size
=
(
char
*
)
de
+
d
ir_reclen
(
de
)
-
data
;
io
->
Information
=
restart_info_pos
;
last_info
=
restart_last_info
;
goto
restart
;
...
...
@@ -1828,7 +1837,7 @@ static int read_directory_getdirentries( int fd, IO_STATUS_BLOCK *io, void *buff
/* move on to the next entry */
if
(
res
>
0
)
{
de
=
(
struct
dirent
*
)((
char
*
)
de
+
d
e
->
d_reclen
);
de
=
(
struct
dirent
*
)((
char
*
)
de
+
d
ir_reclen
(
de
)
);
continue
;
}
if
(
size
<
initial_size
)
break
;
/* already restarted once, give up now */
...
...
include/config.h.in
View file @
54a9c0fc
...
...
@@ -785,6 +785,9 @@
/* Define to 1 if you have the `strtoull' function. */
#undef HAVE_STRTOULL
/* Define to 1 if `d_reclen' is a member of `struct dirent'. */
#undef HAVE_STRUCT_DIRENT_D_RECLEN
/* Define to 1 if `direction' is a member of `struct ff_effect'. */
#undef HAVE_STRUCT_FF_EFFECT_DIRECTION
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment