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
17
Merge Requests
17
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
3642d717
Commit
3642d717
authored
Jan 04, 2018
by
Akira TAGOH
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add FcReadLink to wrap up readlink impl.
parent
767e3aa7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
src/fccfg.c
src/fccfg.c
+2
-2
src/fccompat.c
src/fccompat.c
+19
-0
src/fcint.h
src/fcint.h
+5
-0
No files found.
src/fccfg.c
View file @
3642d717
...
...
@@ -2218,7 +2218,7 @@ FcConfigRealFilename (FcConfig *config,
if
(
n
)
{
char
buf
[
PATH_MAX
];
FcChar8
buf
[
PATH_MAX
];
ssize_t
len
;
if
(
sysroot
)
...
...
@@ -2227,7 +2227,7 @@ FcConfigRealFilename (FcConfig *config,
nn
=
FcStrdup
(
n
);
FcStrFree
(
n
);
if
((
len
=
readlink
((
const
char
*
)
nn
,
buf
,
sizeof
(
buf
)
-
1
))
!=
-
1
)
if
((
len
=
FcReadLink
(
nn
,
buf
,
sizeof
(
buf
)
-
1
))
!=
-
1
)
{
buf
[
len
]
=
0
;
FcStrFree
(
nn
);
...
...
src/fccompat.c
View file @
3642d717
...
...
@@ -37,6 +37,9 @@
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
...
...
@@ -256,6 +259,22 @@ FcMakeDirectory (const FcChar8 *dir)
return
ret
;
}
ssize_t
FcReadLink
(
const
FcChar8
*
pathname
,
FcChar8
*
buf
,
size_t
bufsiz
)
{
#ifdef HAVE_READLINK
return
readlink
((
const
char
*
)
pathname
,
(
char
*
)
buf
,
bufsiz
);
#else
/* XXX: this function is only used for FcConfigRealFilename() so far
* and returning -1 as an error still just works.
*/
errno
=
ENOSYS
;
return
-
1
;
#endif
}
#define __fccompat__
#include "fcaliastail.h"
#undef __fccompat__
src/fcint.h
View file @
3642d717
...
...
@@ -822,6 +822,11 @@ FcRandom (void);
FcPrivate
FcBool
FcMakeDirectory
(
const
FcChar8
*
dir
);
FcPrivate
ssize_t
FcReadLink
(
const
FcChar8
*
pathname
,
FcChar8
*
buf
,
size_t
bufsiz
);
/* fcdbg.c */
FcPrivate
void
...
...
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