1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* dir.c (do_stat, do_lstat, do_opendir): should not warn ENOTDIR.

[ruby-talk:248288]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2007-04-24 00:33:09 +00:00
parent 27d87bb4de
commit 909f0b13b7
3 changed files with 17 additions and 6 deletions

View file

@ -1,3 +1,8 @@
Tue Apr 24 09:33:57 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* dir.c (do_stat, do_lstat, do_opendir): should not warn ENOTDIR.
[ruby-talk:248288]
Mon Apr 23 22:14:42 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/extmk.rb ($ruby): add extout directory to include path.

12
dir.c
View file

@ -958,13 +958,19 @@ sys_warning_1(mesg)
#define GLOB_ALLOC_N(type, n) (type *)malloc(sizeof(type) * (n))
#define GLOB_JUMP_TAG(status) ((status == -1) ? rb_memerror() : rb_jump_tag(status))
/*
* ENOTDIR can be returned by stat(2) if a non-leaf element of the path
* is not a directory.
*/
#define to_be_ignored(e) ((e) == ENOENT || (e) == ENOTDIR)
/* System call with warning */
static int
do_stat(const char *path, struct stat *pst, int flags)
{
int ret = stat(path, pst);
if (ret < 0 && errno != ENOENT)
if (ret < 0 && !to_be_ignored(errno))
sys_warning(path);
return ret;
@ -974,7 +980,7 @@ static int
do_lstat(const char *path, struct stat *pst, int flags)
{
int ret = lstat(path, pst);
if (ret < 0 && errno != ENOENT)
if (ret < 0 && !to_be_ignored(errno))
sys_warning(path);
return ret;
@ -984,7 +990,7 @@ static DIR *
do_opendir(const char *path, int flags)
{
DIR *dirp = opendir(path);
if (dirp == NULL && errno != ENOENT && errno != ENOTDIR)
if (dirp == NULL && !to_be_ignored(errno))
sys_warning(path);
return dirp;

View file

@ -1,7 +1,7 @@
#define RUBY_VERSION "1.8.6"
#define RUBY_RELEASE_DATE "2007-04-23"
#define RUBY_RELEASE_DATE "2007-04-24"
#define RUBY_VERSION_CODE 186
#define RUBY_RELEASE_CODE 20070423
#define RUBY_RELEASE_CODE 20070424
#define RUBY_PATCHLEVEL 5000
#define RUBY_VERSION_MAJOR 1
@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 6
#define RUBY_RELEASE_YEAR 2007
#define RUBY_RELEASE_MONTH 4
#define RUBY_RELEASE_DAY 23
#define RUBY_RELEASE_DAY 24
RUBY_EXTERN const char ruby_version[];
RUBY_EXTERN const char ruby_release_date[];