diff options
author | dougb <dougb@FreeBSD.org> | 2011-09-03 07:13:45 +0000 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2011-09-03 07:13:45 +0000 |
commit | f18a6196d77d71d90e7f726cfc30101abb2958e1 (patch) | |
tree | df1f07c78f187c54ea276c24753c42174127668e /contrib/bind9/lib/isc/unix/file.c | |
parent | fbc49b949e99a3bf0c24ca3f9e542ae398b89dca (diff) | |
parent | 9c893fc637e8791d7faedec39c0993533a1fbb6e (diff) | |
download | FreeBSD-src-f18a6196d77d71d90e7f726cfc30101abb2958e1.zip FreeBSD-src-f18a6196d77d71d90e7f726cfc30101abb2958e1.tar.gz |
Upgrade to BIND version 9.8.1. Release notes at:
https://deepthought.isc.org/article/AA-00446/81/
or
/usr/src/contrib/bind9/
Approved by: re (kib)
Diffstat (limited to 'contrib/bind9/lib/isc/unix/file.c')
-rw-r--r-- | contrib/bind9/lib/isc/unix/file.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/contrib/bind9/lib/isc/unix/file.c b/contrib/bind9/lib/isc/unix/file.c index 25d856c..3e4d3e0 100644 --- a/contrib/bind9/lib/isc/unix/file.c +++ b/contrib/bind9/lib/isc/unix/file.c @@ -48,7 +48,7 @@ * SUCH DAMAGE. */ -/* $Id: file.c,v 1.57 2011-01-11 23:47:14 tbox Exp $ */ +/* $Id: file.c,v 1.57.10.1 2011-03-04 14:10:13 smann Exp $ */ /*! \file */ @@ -348,6 +348,23 @@ isc_file_exists(const char *pathname) { return (ISC_TF(file_stats(pathname, &stats) == ISC_R_SUCCESS)); } +isc_result_t +isc_file_isplainfile(const char *filename) { + /* + * This function returns success if filename is a plain file. + */ + struct stat filestat; + memset(&filestat,0,sizeof(struct stat)); + + if ((stat(filename, &filestat)) == -1) + return(isc__errno2result(errno)); + + if(! S_ISREG(filestat.st_mode)) + return(ISC_R_INVALIDFILE); + + return(ISC_R_SUCCESS); +} + isc_boolean_t isc_file_isabsolute(const char *filename) { REQUIRE(filename != NULL); |