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
153
Issues
153
List
Boards
Labels
Service Desk
Milestones
Merge Requests
18
Merge Requests
18
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
cfb21c7d
Commit
cfb21c7d
authored
May 13, 2018
by
Akira TAGOH
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 106497 - better error description when problem reading font configuration
https://bugs.freedesktop.org/show_bug.cgi?id=106497
parent
af964f78
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
configure.ac
configure.ac
+1
-1
src/fcxml.c
src/fcxml.c
+19
-1
No files found.
configure.ac
View file @
cfb21c7d
...
...
@@ -169,7 +169,7 @@ AC_TYPE_PID_T
# Checks for library functions.
AC_FUNC_VPRINTF
AC_FUNC_MMAP
AC_CHECK_FUNCS([link mkstemp mkostemp _mktemp_s mkdtemp getopt getopt_long getprogname getexecname rand random lrand48 random_r rand_r readlink fstatvfs fstatfs lstat])
AC_CHECK_FUNCS([link mkstemp mkostemp _mktemp_s mkdtemp getopt getopt_long getprogname getexecname rand random lrand48 random_r rand_r readlink fstatvfs fstatfs lstat
strerror strerror_r
])
dnl AC_CHECK_FUNCS doesn't check for header files.
dnl posix_fadvise() may be not available in older libc.
...
...
src/fcxml.c
View file @
cfb21c7d
...
...
@@ -22,6 +22,10 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef _GNU_SOURCE
#undef _GNU_SOURCE
/* To use the POSIX version of strerror_r */
#endif
#include <string.h>
#include "fcint.h"
#include <fcntl.h>
#include <stdarg.h>
...
...
@@ -3451,7 +3455,21 @@ _FcConfigParse (FcConfig *config,
len
=
read
(
fd
,
buf
,
BUFSIZ
);
if
(
len
<
0
)
{
FcConfigMessage
(
0
,
FcSevereError
,
"failed reading config file"
);
int
errno_
=
errno
;
char
ebuf
[
BUFSIZ
+
1
];
#if HAVE_STRERROR_R
int
x
FC_UNUSED
;
x
=
strerror_r
(
errno_
,
ebuf
,
BUFSIZ
);
/* make sure we use the POSIX version of strerror_r */
#elif HAVE_STRERROR
char
*
tmp
=
strerror
(
errno_
);
size_t
len
=
strlen
(
tmp
);
strncpy
(
ebuf
,
tmp
,
FC_MIN
(
BUFSIZ
,
len
));
ebuf
[
FC_MIN
(
BUFSIZ
,
len
)]
=
0
;
#else
ebuf
[
0
]
=
0
;
#endif
FcConfigMessage
(
0
,
FcSevereError
,
"failed reading config file: %s: %s (errno %d)"
,
realfilename
,
ebuf
,
errno_
);
close
(
fd
);
goto
bail1
;
}
...
...
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