From 44c0b9d7da76df4af525c04f7e2af0d0e04adf28 Mon Sep 17 00:00:00 2001 From: Pavel Sanda Date: Wed, 23 Mar 2011 14:28:23 +0000 Subject: [PATCH] Fix samba related crashes http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg166543.html git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38003 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/support/FileName.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/support/FileName.cpp b/src/support/FileName.cpp index 54c6fc9fd9..470ff90911 100644 --- a/src/support/FileName.cpp +++ b/src/support/FileName.cpp @@ -543,7 +543,9 @@ unsigned long FileName::checksum() const return result; struct stat info; - fstat(fd, &info); + if (fstat(fd, &info)) + // bug 5891 + return result; void * mm = mmap(0, info.st_size, PROT_READ, MAP_PRIVATE, fd, 0);