diff options
author | marha <marha@users.sourceforge.net> | 2011-02-09 07:47:31 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-02-09 07:47:31 +0000 |
commit | 51a59b7f7f9b134791d3b09673063e4c45ea9eee (patch) | |
tree | 52bb43362452042efcdebd64a85d7aa75319b64a /libX11/src/Xrm.c | |
parent | 53bf2508fe3d5bd7889ccf4817fcd2bcc531d6ae (diff) | |
download | vcxsrv-51a59b7f7f9b134791d3b09673063e4c45ea9eee.tar.gz vcxsrv-51a59b7f7f9b134791d3b09673063e4c45ea9eee.tar.bz2 vcxsrv-51a59b7f7f9b134791d3b09673063e4c45ea9eee.zip |
libX11 mesa git update 9 Feb 2011
Diffstat (limited to 'libX11/src/Xrm.c')
-rw-r--r-- | libX11/src/Xrm.c | 15 |
1 files changed, 8 insertions, 7 deletions
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 <X11/Xos.h> +#include <sys/stat.h> #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' */ |