* 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/trunk@12210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2007-04-24 00:33:09 +00:00
Родитель 42b3d60056
Коммит 787c3ead18
3 изменённых файлов: 17 добавлений и 6 удалений

Просмотреть файл

@ -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
Просмотреть файл

@ -928,13 +928,19 @@ sys_warning_1(const char* 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;
@ -944,7 +950,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;
@ -954,7 +960,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;

Просмотреть файл

@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0"
#define RUBY_RELEASE_DATE "2007-04-23"
#define RUBY_RELEASE_DATE "2007-04-24"
#define RUBY_VERSION_CODE 190
#define RUBY_RELEASE_CODE 20070423
#define RUBY_RELEASE_CODE 20070424
#define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1
@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 0
#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[];