diff options
author | fwarmerdam <fwarmerdam> | 2012-06-01 21:40:58 +0000 |
---|---|---|
committer | fwarmerdam <fwarmerdam> | 2012-06-01 21:40:58 +0000 |
commit | 97c8a67c25bf5eda6e6ebc4177048ef916322e55 (patch) | |
tree | b146e6246b499f7b8705368ce3cf7b9889755031 | |
parent | c41ca862c46f57375c5bcf80f360d4d6e9ec0f47 (diff) | |
download | libtiff-97c8a67c25bf5eda6e6ebc4177048ef916322e55.tar.gz |
use strerror() for open error messages on unix (#2341)
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | libtiff/tif_unix.c | 8 |
2 files changed, 10 insertions, 2 deletions
@@ -1,5 +1,9 @@ 2012-06-01 Frank Warmerdam <warmerdam@google.com> + * libtiff/tif_unix.c: use strerror() to return a more specific error message + on failed open. + http://bugzilla.maptools.org/show_bug.cgi?id=2341 + * libtiff/tif_jpeg.c: Fix JPEGDecodeRaw() bugs. http://bugzilla.maptools.org/show_bug.cgi?id=2386 diff --git a/libtiff/tif_unix.c b/libtiff/tif_unix.c index 7c5cc50f..1387558f 100644 --- a/libtiff/tif_unix.c +++ b/libtiff/tif_unix.c @@ -1,4 +1,4 @@ -/* $Id: tif_unix.c,v 1.22 2010-03-10 18:56:49 bfriesen Exp $ */ +/* $Id: tif_unix.c,v 1.23 2012-06-01 21:40:59 fwarmerdam Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -186,7 +186,11 @@ TIFFOpen(const char* name, const char* mode) fd = open(name, m, 0666); if (fd < 0) { - TIFFErrorExt(0, module, "%s: Cannot open", name); + if (errno > 0 && strerror(errno) != NULL ) { + TIFFErrorExt(0, module, "%s: %s", name, strerror(errno) ); + } else { + TIFFErrorExt(0, module, "%s: Cannot open", name); + } return ((TIFF *)0); } |