Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
10633fd8
Commit
10633fd8
authored
Apr 12, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.0
into neptunus.(none):/home/msvensson/mysql/mysql-5.0
parents
53e47e3b
c3d37c2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
47 deletions
+50
-47
mysys/my_lib.c
mysys/my_lib.c
+50
-47
No files found.
mysys/my_lib.c
View file @
10633fd8
...
@@ -384,11 +384,10 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
...
@@ -384,11 +384,10 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
DBUG_PRINT
(
"my"
,(
"path: '%s' stat: %d MyFlags: %d"
,
path
,
MyFlags
));
DBUG_PRINT
(
"my"
,(
"path: '%s' stat: %d MyFlags: %d"
,
path
,
MyFlags
));
/* Put LIB-CHAR as last path-character if not there */
/* Put LIB-CHAR as last path-character if not there */
tmp_file
=
tmp_path
;
tmp_file
=
tmp_path
;
if
(
!*
path
)
if
(
!*
path
)
*
tmp_file
++
=
'.'
;
/* From current dir */
*
tmp_file
++
=
'.'
;
/* From current dir */
tmp_file
=
str
mov
(
tmp_file
,
path
);
tmp_file
=
str
nmov
(
tmp_file
,
path
,
FN_REFLEN
-
5
);
if
(
tmp_file
[
-
1
]
==
FN_DEVCHAR
)
if
(
tmp_file
[
-
1
]
==
FN_DEVCHAR
)
*
tmp_file
++=
'.'
;
/* From current dev-dir */
*
tmp_file
++=
'.'
;
/* From current dev-dir */
if
(
tmp_file
[
-
1
]
!=
FN_LIBCHAR
)
if
(
tmp_file
[
-
1
]
!=
FN_LIBCHAR
)
...
@@ -424,7 +423,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
...
@@ -424,7 +423,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
if
((
handle
=
_findfirst
(
tmp_path
,
&
find
))
==
-
1L
)
if
((
handle
=
_findfirst
(
tmp_path
,
&
find
))
==
-
1L
)
#endif
#endif
{
{
DBUG_PRINT
(
"info"
,
(
"find
_first returned error"
));
DBUG_PRINT
(
"info"
,
(
"find
first returned error, errno: %d"
,
errno
));
if
(
errno
!=
EINVAL
)
if
(
errno
!=
EINVAL
)
goto
error
;
goto
error
;
/*
/*
...
@@ -433,72 +432,76 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
...
@@ -433,72 +432,76 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
continue and return zero files in dir
continue and return zero files in dir
*/
*/
}
}
else
do
{
{
do
{
#ifdef __BORLANDC__
#ifdef __BORLANDC__
attrib
=
find
.
ff_attrib
;
attrib
=
find
.
ff_attrib
;
#else
#else
attrib
=
find
.
attrib
;
attrib
=
find
.
attrib
;
/*
/*
Do not show hidden and system files which Windows sometimes create.
Do not show hidden and system files which Windows sometimes create.
Note. Because Borland's findfirst() is called with the third
Note. Because Borland's findfirst() is called with the third
argument = 0 hidden/system files are excluded from the search.
argument = 0 hidden/system files are excluded from the search.
*/
*/
if
(
attrib
&
(
_A_HIDDEN
|
_A_SYSTEM
))
if
(
attrib
&
(
_A_HIDDEN
|
_A_SYSTEM
))
continue
;
continue
;
#endif
#endif
#ifdef __BORLANDC__
#ifdef __BORLANDC__
if
(
!
(
finfo
.
name
=
strdup_root
(
names_storage
,
find
.
ff_name
)))
if
(
!
(
finfo
.
name
=
strdup_root
(
names_storage
,
find
.
ff_name
)))
goto
error
;
goto
error
;
#else
#else
if
(
!
(
finfo
.
name
=
strdup_root
(
names_storage
,
find
.
name
)))
if
(
!
(
finfo
.
name
=
strdup_root
(
names_storage
,
find
.
name
)))
goto
error
;
#endif
if
(
MyFlags
&
MY_WANT_STAT
)
{
if
(
!
(
finfo
.
mystat
=
(
MY_STAT
*
)
alloc_root
(
names_storage
,
sizeof
(
MY_STAT
))))
goto
error
;
goto
error
;
#endif
bzero
(
finfo
.
mystat
,
sizeof
(
MY_STAT
));
if
(
MyFlags
&
MY_WANT_STAT
)
{
if
(
!
(
finfo
.
mystat
=
(
MY_STAT
*
)
alloc_root
(
names_storage
,
sizeof
(
MY_STAT
))))
goto
error
;
bzero
(
finfo
.
mystat
,
sizeof
(
MY_STAT
));
#ifdef __BORLANDC__
#ifdef __BORLANDC__
finfo
.
mystat
->
st_size
=
find
.
ff_fsize
;
finfo
.
mystat
->
st_size
=
find
.
ff_fsize
;
#else
#else
finfo
.
mystat
->
st_size
=
find
.
size
;
finfo
.
mystat
->
st_size
=
find
.
size
;
#endif
#endif
mode
=
MY_S_IREAD
;
mode
=
MY_S_IREAD
;
if
(
!
(
attrib
&
_A_RDONLY
))
if
(
!
(
attrib
&
_A_RDONLY
))
mode
|=
MY_S_IWRITE
;
mode
|=
MY_S_IWRITE
;
if
(
attrib
&
_A_SUBDIR
)
if
(
attrib
&
_A_SUBDIR
)
mode
|=
MY_S_IFDIR
;
mode
|=
MY_S_IFDIR
;
finfo
.
mystat
->
st_mode
=
mode
;
finfo
.
mystat
->
st_mode
=
mode
;
#ifdef __BORLANDC__
#ifdef __BORLANDC__
finfo
.
mystat
->
st_mtime
=
((
uint32
)
find
.
ff_ftime
);
finfo
.
mystat
->
st_mtime
=
((
uint32
)
find
.
ff_ftime
);
#else
#else
finfo
.
mystat
->
st_mtime
=
((
uint32
)
find
.
time_write
);
finfo
.
mystat
->
st_mtime
=
((
uint32
)
find
.
time_write
);
#endif
#endif
}
}
else
else
finfo
.
mystat
=
NULL
;
finfo
.
mystat
=
NULL
;
if
(
push_dynamic
(
dir_entries_storage
,
(
gptr
)
&
finfo
))
if
(
push_dynamic
(
dir_entries_storage
,
(
gptr
)
&
finfo
))
goto
error
;
goto
error
;
}
#ifdef __BORLANDC__
#ifdef __BORLANDC__
}
while
(
findnext
(
&
find
)
==
0
);
while
(
findnext
(
&
find
)
==
0
);
#else
#else
}
while
(
_findnext
(
handle
,
&
find
)
==
0
);
while
(
_findnext
(
handle
,
&
find
)
==
0
);
_findclose
(
handle
);
_findclose
(
handle
);
#endif
#endif
}
result
->
dir_entry
=
(
FILEINFO
*
)
dir_entries_storage
->
buffer
;
result
->
dir_entry
=
(
FILEINFO
*
)
dir_entries_storage
->
buffer
;
result
->
number_off_files
=
dir_entries_storage
->
elements
;
result
->
number_off_files
=
dir_entries_storage
->
elements
;
if
(
!
(
MyFlags
&
MY_DONT_SORT
))
if
(
!
(
MyFlags
&
MY_DONT_SORT
))
qsort
((
void
*
)
result
->
dir_entry
,
result
->
number_off_files
,
qsort
((
void
*
)
result
->
dir_entry
,
result
->
number_off_files
,
sizeof
(
FILEINFO
),
(
qsort_cmp
)
comp_names
);
sizeof
(
FILEINFO
),
(
qsort_cmp
)
comp_names
);
DBUG_PRINT
(
exit
,
(
"found %d files"
,
result
->
number_off_files
));
DBUG_RETURN
(
result
);
DBUG_RETURN
(
result
);
error:
error:
my_errno
=
errno
;
my_errno
=
errno
;
...
...
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