Skip to content

Commit

Permalink
* node.h (rb_notimplement_body_p): declared.
Browse files Browse the repository at this point in the history
* vm_method.c (Init_eval_method): suppress a warning.

* io.c (rb_io_fsync): use rb_f_notimplement if not implemented.
  (rb_io_close_on_exec_p): ditto.
  (rb_io_set_close_on_exec): ditto.
  (rb_io_fcntl): ditto.
  (rb_f_syscall): ditto.

* dir.c (dir_tell): ditto.
  (dir_seek): ditto.
  (dir_s_chroot): ditto.

* process.c (proc_getpgrp): ditto.
  (proc_setpgrp): ditto.
  (proc_getpgid): ditto.
  (proc_setpgid): ditto.
  (proc_setsid): ditto.
  (proc_getpriority): ditto.
  (proc_setpriority): ditto.
  (proc_getrlimit): ditto.
  (proc_setrlimit): ditto.
  (p_sys_setuid): ditto.
  (p_sys_setruid): ditto.
  (p_sys_seteuid): ditto.
  (p_sys_setreuid): ditto.
  (p_sys_setresuid): ditto.
  (p_sys_setgid): ditto.
  (p_sys_setrgid): ditto.
  (p_sys_setegid): ditto.
  (p_sys_setregid): ditto.
  (p_sys_setreuid): ditto.
  (p_sys_setresgid): ditto.
  (p_sys_issetugid): ditto.
  (proc_getgroups): ditto.
  (proc_setgroups): ditto.
  (proc_initgroups): ditto.
  (proc_daemon): ditto.
  (rb_proc_times): ditto.

* file.c (rb_file_s_lchown): ditto.
  (rb_file_s_link): ditto.
  (rb_file_s_symlink): ditto.
  (rb_file_s_readlink): ditto.
  (rb_file_s_truncate): ditto.
  (rb_file_truncate): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
akr committed Apr 16, 2009
1 parent 50cea7a commit 8e8ae2a
Show file tree
Hide file tree
Showing 8 changed files with 193 additions and 157 deletions.
50 changes: 50 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
Fri Apr 17 01:51:17 2009 Tanaka Akira <[email protected]>

* node.h (rb_notimplement_body_p): declared.

* vm_method.c (Init_eval_method): suppress a warning.

* io.c (rb_io_fsync): use rb_f_notimplement if not implemented.
(rb_io_close_on_exec_p): ditto.
(rb_io_set_close_on_exec): ditto.
(rb_io_fcntl): ditto.
(rb_f_syscall): ditto.

* dir.c (dir_tell): ditto.
(dir_seek): ditto.
(dir_s_chroot): ditto.

* process.c (proc_getpgrp): ditto.
(proc_setpgrp): ditto.
(proc_getpgid): ditto.
(proc_setpgid): ditto.
(proc_setsid): ditto.
(proc_getpriority): ditto.
(proc_setpriority): ditto.
(proc_getrlimit): ditto.
(proc_setrlimit): ditto.
(p_sys_setuid): ditto.
(p_sys_setruid): ditto.
(p_sys_seteuid): ditto.
(p_sys_setreuid): ditto.
(p_sys_setresuid): ditto.
(p_sys_setgid): ditto.
(p_sys_setrgid): ditto.
(p_sys_setegid): ditto.
(p_sys_setregid): ditto.
(p_sys_setreuid): ditto.
(p_sys_setresgid): ditto.
(p_sys_issetugid): ditto.
(proc_getgroups): ditto.
(proc_setgroups): ditto.
(proc_initgroups): ditto.
(proc_daemon): ditto.
(rb_proc_times): ditto.

* file.c (rb_file_s_lchown): ditto.
(rb_file_s_link): ditto.
(rb_file_s_symlink): ditto.
(rb_file_s_readlink): ditto.
(rb_file_s_truncate): ditto.
(rb_file_truncate): ditto.

Fri Apr 17 00:53:47 2009 Yusuke Endoh <[email protected]>

* lib/cgi/core.rb (read_multipart): When path is not defined,
Expand Down
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ with all sufficient information, see the ChangeLog file.
* Kernel
* extended methods:
* respond_to? returns false for not-implemented methods
such as fork on Windows.
such as Process.fork on Windows.

* rss

Expand Down
19 changes: 9 additions & 10 deletions dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ dir_each(VALUE dir)
return dir;
}

#ifdef HAVE_TELLDIR
/*
* call-seq:
* dir.pos => integer
Expand All @@ -566,18 +567,18 @@ dir_each(VALUE dir)
static VALUE
dir_tell(VALUE dir)
{
#ifdef HAVE_TELLDIR
struct dir_data *dirp;
long pos;

GetDIR(dir, dirp);
pos = telldir(dirp->dir);
return rb_int2inum(pos);
}
#else
rb_notimplement();
#define dir_tell rb_f_notimplement
#endif
}

#ifdef HAVE_SEEKDIR
/*
* call-seq:
* dir.seek( integer ) => dir
Expand All @@ -599,13 +600,12 @@ dir_seek(VALUE dir, VALUE pos)
long p = NUM2LONG(pos);

GetDIR(dir, dirp);
#ifdef HAVE_SEEKDIR
seekdir(dirp->dir, p);
return dir;
}
#else
rb_notimplement();
#define dir_seek rb_f_notimplement
#endif
}

/*
* call-seq:
Expand Down Expand Up @@ -826,6 +826,7 @@ check_dirname(volatile VALUE *dir)
}
}

#if defined(HAVE_CHROOT) && !defined(__CHECKER__)
/*
* call-seq:
* Dir.chroot( string ) => 0
Expand All @@ -838,18 +839,16 @@ check_dirname(volatile VALUE *dir)
static VALUE
dir_s_chroot(VALUE dir, VALUE path)
{
#if defined(HAVE_CHROOT) && !defined(__CHECKER__)
check_dirname(&path);

if (chroot(RSTRING_PTR(path)) == -1)
rb_sys_fail(RSTRING_PTR(path));

return INT2FIX(0);
}
#else
rb_notimplement();
return Qnil; /* not reached */
#define dir_s_chroot rb_f_notimplement
#endif
}

/*
* call-seq:
Expand Down
47 changes: 20 additions & 27 deletions file.c
Original file line number Diff line number Diff line change
Expand Up @@ -2066,11 +2066,7 @@ rb_file_s_lchown(int argc, VALUE *argv)
return LONG2FIX(n);
}
#else
static VALUE
rb_file_s_lchown(int argc, VALUE *argv)
{
rb_notimplement();
}
#define rb_file_s_lchown rb_f_notimplement
#endif

struct timespec rb_time_timespec(VALUE time);
Expand Down Expand Up @@ -2244,6 +2240,7 @@ sys_fail2(VALUE s1, VALUE s2)
rb_sys_fail(buf);
}

#ifdef HAVE_LINK
/*
* call-seq:
* File.link(old_name, new_name) => 0
Expand All @@ -2259,7 +2256,6 @@ sys_fail2(VALUE s1, VALUE s2)
static VALUE
rb_file_s_link(VALUE klass, VALUE from, VALUE to)
{
#ifdef HAVE_LINK
rb_secure(2);
FilePathValue(from);
FilePathValue(to);
Expand All @@ -2268,12 +2264,12 @@ rb_file_s_link(VALUE klass, VALUE from, VALUE to)
sys_fail2(from, to);
}
return INT2FIX(0);
}
#else
rb_notimplement();
return Qnil; /* not reached */
#define rb_file_s_link rb_f_notimplement
#endif
}

#ifdef HAVE_SYMLINK
/*
* call-seq:
* File.symlink(old_name, new_name) => 0
Expand All @@ -2289,7 +2285,6 @@ rb_file_s_link(VALUE klass, VALUE from, VALUE to)
static VALUE
rb_file_s_symlink(VALUE klass, VALUE from, VALUE to)
{
#ifdef HAVE_SYMLINK
rb_secure(2);
FilePathValue(from);
FilePathValue(to);
Expand All @@ -2298,12 +2293,12 @@ rb_file_s_symlink(VALUE klass, VALUE from, VALUE to)
sys_fail2(from, to);
}
return INT2FIX(0);
}
#else
rb_notimplement();
return Qnil; /* not reached */
#define rb_file_s_symlink rb_f_notimplement
#endif
}

#ifdef HAVE_READLINK
/*
* call-seq:
* File.readlink(link_name) -> file_name
Expand All @@ -2318,7 +2313,6 @@ rb_file_s_symlink(VALUE klass, VALUE from, VALUE to)
static VALUE
rb_file_s_readlink(VALUE klass, VALUE path)
{
#ifdef HAVE_READLINK
char *buf;
int size = 100;
ssize_t rv;
Expand All @@ -2343,11 +2337,10 @@ rb_file_s_readlink(VALUE klass, VALUE path)
xfree(buf);

return v;
}
#else
rb_notimplement();
return Qnil; /* not reached */
#define rb_file_s_readlink rb_f_notimplement
#endif
}

static void
unlink_internal(const char *path, void *arg)
Expand Down Expand Up @@ -3383,6 +3376,7 @@ rb_file_s_join(VALUE klass, VALUE args)
return rb_file_join(args, separator);
}

#if defined(HAVE_TRUNCATE) || defined(HAVE_CHSIZE)
/*
* call-seq:
* File.truncate(file_name, integer) => 0
Expand All @@ -3409,8 +3403,7 @@ rb_file_s_truncate(VALUE klass, VALUE path, VALUE len)
#ifdef HAVE_TRUNCATE
if (truncate(StringValueCStr(path), pos) < 0)
rb_sys_fail(RSTRING_PTR(path));
#else
# ifdef HAVE_CHSIZE
#else /* defined(HAVE_CHSIZE) */
{
int tmpfd;

Expand All @@ -3429,13 +3422,14 @@ rb_file_s_truncate(VALUE klass, VALUE path, VALUE len)
}
close(tmpfd);
}
# else
rb_notimplement();
# endif
#endif
return INT2FIX(0);
}
#else
#define rb_file_s_truncate rb_f_notimplement
#endif

#if defined(HAVE_FTRUNCATE) || defined(HAVE_CHSIZE)
/*
* call-seq:
* file.truncate(integer) => 0
Expand Down Expand Up @@ -3466,16 +3460,15 @@ rb_file_truncate(VALUE obj, VALUE len)
#ifdef HAVE_FTRUNCATE
if (ftruncate(fptr->fd, pos) < 0)
rb_sys_fail_path(fptr->pathv);
#else
# ifdef HAVE_CHSIZE
#else /* defined(HAVE_CHSIZE) */
if (chsize(fptr->fd, pos) < 0)
rb_sys_fail(fptr->pathv);
# else
rb_notimplement();
# endif
#endif
return INT2FIX(0);
}
#else
#define rb_file_truncate rb_f_notimplement
#endif

# ifndef LOCK_SH
# define LOCK_SH 1
Expand Down
Loading

0 comments on commit 8e8ae2a

Please sign in to comment.