aboutsummaryrefslogtreecommitdiffstats
path: root/libskrift_open_font_at.c
diff options
context:
space:
mode:
Diffstat (limited to 'libskrift_open_font_at.c')
-rw-r--r--libskrift_open_font_at.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libskrift_open_font_at.c b/libskrift_open_font_at.c
index 2927dea..8745991 100644
--- a/libskrift_open_font_at.c
+++ b/libskrift_open_font_at.c
@@ -4,7 +4,7 @@
int
libskrift_open_font_at(LIBSKRIFT_FONT **fontp, int dirfd, const char *path)
{
- int fd, ret;
+ int fd, ret, saved_errno;
if (!*path) {
return libskrift_open_font_fd(fontp, dirfd);
} else {
@@ -12,7 +12,9 @@ libskrift_open_font_at(LIBSKRIFT_FONT **fontp, int dirfd, const char *path)
if (fd < 0)
return -1;
ret = libskrift_open_font_fd(fontp, fd);
+ saved_errno = errno;
close(fd);
+ errno = saved_errno;
return ret;
}
}