Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fontconfig
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
152
Issues
152
List
Boards
Labels
Service Desk
Milestones
Merge Requests
22
Merge Requests
22
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fontconfig
fontconfig
Commits
5254a663
Commit
5254a663
authored
May 31, 2012
by
Akira TAGOH
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a typo and polish the previous change
parent
4a741e9a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
13 deletions
+8
-13
src/fcstat.c
src/fcstat.c
+8
-13
No files found.
src/fcstat.c
View file @
5254a663
...
...
@@ -26,6 +26,7 @@
#include "fcint.h"
#include "fcarch.h"
#include <dirent.h>
#include <limits.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
...
...
@@ -159,16 +160,14 @@ Adler32Finish (struct Adler32 *ctx)
return
ctx
->
a
+
(
ctx
->
b
<<
16
);
}
#ifdef HAVE_STRUCT_DIRENT_D_TYPE
/* dirent.d_type can be relied upon on FAT filesystem */
static
FcBool
FcDirChecksumScandirFilter
(
const
struct
dirent
*
entry
)
{
#ifdef HAVE_STRUCT_DIRENT_D_TYPE
return
entry
->
d_type
!=
DT_DIR
;
#else
return
FcFalse
;
#endif
}
#endif
static
int
FcDirChecksumScandirSorter
(
const
struct
dirent
**
lhs
,
const
struct
dirent
**
rhs
)
...
...
@@ -189,7 +188,11 @@ FcDirChecksum (const FcChar8 *dir, time_t *checksum)
Adler32Init
(
&
ctx
);
n
=
scandir
((
const
char
*
)
dir
,
&
files
,
#ifdef HAVE_STRUCT_DIRENT_D_TYPE
&
FcDirChecksumScandirFilter
,
#else
NULL
,
#endif
&
FcDirChecksumScandirSorter
);
if
(
n
==
-
1
)
return
-
1
;
...
...
@@ -203,14 +206,8 @@ FcDirChecksum (const FcChar8 *dir, time_t *checksum)
dtype
=
files
[
n
]
->
d_type
;
#else
struct
stat
statb
;
char
*
f
;
char
f
[
PATH_MAX
+
1
]
;
f
=
malloc
(
len
+
1
+
dlen
+
1
);
if
(
!
f
)
{
ret
=
-
1
;
goto
bail
;
}
memcpy
(
f
,
dir
,
len
);
f
[
len
]
=
FC_DIR_SEPARATOR
;
memcpy
(
&
f
[
len
+
1
],
files
[
n
]
->
d_name
,
dlen
);
...
...
@@ -230,8 +227,6 @@ FcDirChecksum (const FcChar8 *dir, time_t *checksum)
#ifndef HAVE_STRUCT_DIRENT_D_TYPE
bail:
if
(
f
)
free
(
f
);
#endif
free
(
files
[
n
]);
}
...
...
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