Better error message displayed when file cannot be opened
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7416 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
c5fa9623b8
commit
bed81d66d3
22 changed files with 89 additions and 56 deletions
|
|
@ -17,6 +17,7 @@ char cvsroot_file_c[] = "$Header$";
|
|||
#ifdef DOH_INTFILE
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
|
||||
typedef struct {
|
||||
FILE *filep;
|
||||
|
|
@ -291,3 +292,16 @@ DohNewFileFromFd(int fd)
|
|||
f->closeondel = 0;
|
||||
return DohObjMalloc(&DohFileType,f);
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* FileErrorDisplay()
|
||||
*
|
||||
* Display cause of one the NewFile functions failing.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
DohFileErrorDisplay(DOHString *filename)
|
||||
{
|
||||
Printf(stderr, "Unable to open file %s: %s\n", filename, strerror(errno));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue