summaryrefslogtreecommitdiff
path: root/vcl/generic
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-11-10 13:54:37 +0200
committerNoel Grandin <noel@peralex.com>2014-11-10 13:57:41 +0200
commit8fc7e856ccc3ba19158c6d86d507d9b7a0b140b8 (patch)
tree664a1f287100c23cafebcc11e437f4ee886406fa /vcl/generic
parent7f86fc0b9835be4d2c3e98271b32454f8df427ec (diff)
cid#736944 Time of check time of use
Change-Id: Ie9160e8d5ee7f8416a4526a280db23316488a2a1
Diffstat (limited to 'vcl/generic')
-rw-r--r--vcl/generic/print/genpspgraphics.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx
index 3b2ce07de4a9..db904da984cf 100644
--- a/vcl/generic/print/genpspgraphics.cxx
+++ b/vcl/generic/print/genpspgraphics.cxx
@@ -1247,12 +1247,15 @@ const void* GenPspGraphics::DoGetEmbedFontData( psp::fontID aFont, const sal_Ucs
OString aSysPath = rMgr.getFontFileSysPath( aFont );
#if defined( UNX )
- struct stat aStat;
- if( stat( aSysPath.getStr(), &aStat ) )
- return NULL;
int fd = open( aSysPath.getStr(), O_RDONLY );
if( fd < 0 )
return NULL;
+ struct stat aStat;
+ if( fstat( fd, &aStat ) )
+ {
+ close( fd );
+ return NULL;
+ }
void* pFile = mmap( NULL, aStat.st_size, PROT_READ, MAP_SHARED, fd, 0 );
close( fd );
if( pFile == MAP_FAILED )