From 51a59b7f7f9b134791d3b09673063e4c45ea9eee Mon Sep 17 00:00:00 2001 From: marha Date: Wed, 9 Feb 2011 07:47:31 +0000 Subject: libX11 mesa git update 9 Feb 2011 --- libX11/src/Xrm.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'libX11/src/Xrm.c') diff --git a/libX11/src/Xrm.c b/libX11/src/Xrm.c index fbc8ad293..c466cae7f 100644 --- a/libX11/src/Xrm.c +++ b/libX11/src/Xrm.c @@ -60,8 +60,8 @@ from The Open Group. #ifdef XTHREADS #include "locking.h" #endif -#include "XrmI.h" #include +#include #include "Xresinternal.h" #include "Xresource.h" @@ -1594,12 +1594,13 @@ ReadInFile(_Xconst char *filename) * result that the number of bytes actually read with be <= * to the size returned by fstat. */ - GetSizeOfFile(fd, size); - - /* There might have been a problem trying to stat a file */ - if (size == -1) { - close (fd); - return (char *)NULL; + { + struct stat status_buffer; + if ( (fstat(fd, &status_buffer)) == -1 ) { + close (fd); + return (char *)NULL; + } else + size = status_buffer.st_size; } if (!(filebuf = Xmalloc(size + 1))) { /* leave room for '\0' */ -- cgit v1.2.3