Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

2000-06-13

git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit 87af593ce27b48ca27ee8b5e5278ec2abbad5a5f 1 parent 00c5f6b
matz authored
Showing with 69 additions and 18 deletions.
  1. +12 −0 ChangeLog
  2. +2 −1  ToDo
  3. +24 −4 io.c
  4. +17 −3 process.c
  5. +12 −8 re.c
  6. +2 −2 version.h
View
12 ChangeLog
@@ -1,3 +1,15 @@
+Tue Jun 13 11:46:17 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * process.c (proc_setsid): try implement it using setpgrp() and
+ ioctl(fd, TIOCNOTTY, NULL).
+
+ * re.c (rb_reg_prepare_re): magic variable $= should affect regex
+ pattern match.
+
+ * time.c (make_time_t): use tm.tm_gmtoff if possible.
+
+ * time.c (time_zone): use tm.tm_zone if available.
+
Mon Jun 12 23:41:54 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
* configure.in (daylight): avoid GCC optimization.
View
3  ToDo
@@ -44,7 +44,8 @@ Hacking Interpreter
* scrambled script, or script filter
* setuid ruby
* performance tune for in-block (dynamic) local variables.
-* generational GC ?? (is it possible?)
+* generational GC ?
+* give warnings to assign magic variables.
Standard Libraries
View
28 io.c
@@ -498,6 +498,10 @@ io_fread(ptr, len, f)
c = getc(f);
TRAP_END;
if (c == EOF) {
+ if (ferror(f)) {
+ if (errno == EINTR) continue;
+ rb_sys_fail(0);
+ }
*ptr = '\0';
break;
}
@@ -624,7 +628,10 @@ rb_io_gets_internal(argc, argv, io)
c = getc(f);
TRAP_END;
if (c == EOF) {
- if (ferror(f) && errno == EINTR) continue;
+ if (ferror(f)) {
+ if (errno == EINTR) continue;
+ rb_sys_fail(fptr->path);
+ }
break;
}
if ((*bp++ = c) == newline) break;
@@ -711,7 +718,10 @@ rb_io_gets(io)
c = getc(f);
TRAP_END;
if (c == EOF) {
- if (ferror(f) && errno == EINTR) continue;
+ if (ferror(f)) {
+ if (errno == EINTR) continue;
+ rb_sys_fail(fptr->path);
+ }
break;
}
if ((*bp++ = c) == '\n') break;
@@ -865,7 +875,13 @@ rb_io_each_byte(io)
TRAP_BEG;
c = getc(f);
TRAP_END;
- if (c == EOF) break;
+ if (c == EOF) {
+ if (ferror(f)) {
+ if (errno == EINTR) continue;
+ rb_sys_fail(fptr->path);
+ }
+ break;
+ }
rb_yield(INT2FIX(c & 0xff));
}
if (ferror(f)) rb_sys_fail(fptr->path);
@@ -884,13 +900,17 @@ rb_io_getc(io)
rb_io_check_readable(fptr);
f = fptr->f;
+ retry:
READ_CHECK(f);
TRAP_BEG;
c = getc(f);
TRAP_END;
if (c == EOF) {
- if (ferror(f)) rb_sys_fail(fptr->path);
+ if (ferror(f)) {
+ if (errno == EINTR) goto retry;
+ rb_sys_fail(fptr->path);
+ }
return Qnil;
}
return INT2FIX(c & 0xff);
View
20 process.c
@@ -826,13 +826,29 @@ proc_setpgid(obj, pid, pgrp)
static VALUE
proc_setsid()
{
-#ifdef HAVE_SETSID
+#if defined(HAVE_SETSID)
int pid;
rb_secure(2);
pid = setsid();
if (pid < 0) rb_sys_fail(0);
return INT2FIX(pid);
+#elif defined(HAVE_SETPGRP) && defined(TIOCNOTTY)
+ pid_t sid;
+
+#if defined(SETPGRP_VOID)
+ sid = setpgrp();
+#else
+ sid = setpgrp(0, getpid());
+#endif
+ if (sid == -1) return -1;
+
+ if ((fd = open("/dev/tty", O_RDWR)) >= 0) {
+ ioctl(fd, TIOCNOTTY, NULL);
+ close(fd);
+ }
+ return sid;
+}
#else
rb_notimplement();
#endif
@@ -1025,9 +1041,7 @@ Init_process()
#endif
#endif
-#if !defined(NT)
rb_define_singleton_method(rb_mProcess, "fork", rb_f_fork, 0);
-#endif
rb_define_singleton_method(rb_mProcess, "exit!", rb_f_exit_bang, -1);
rb_define_module_function(rb_mProcess, "kill", rb_f_kill, -1);
#ifndef NT
View
20 re.c
@@ -520,16 +520,20 @@ rb_reg_prepare_re(re)
VALUE re;
{
int need_recompile = 0;
+ int state;
rb_reg_check(re);
- /* case-flag not set for the object */
- if (!(RREGEXP(re)->ptr->options & RE_OPTION_IGNORECASE)) {
- int state = FL_TEST(re, REG_CASESTATE);
-
- if ((ruby_ignorecase || state) && !(ruby_ignorecase && state)) {
- RBASIC(re)->flags ^= REG_CASESTATE;
- need_recompile = 1;
- }
+ state = FL_TEST(re, REG_CASESTATE);
+ /* ignorecase status */
+ if (ruby_ignorecase && !state) {
+ FL_SET(re, REG_CASESTATE);
+ RREGEXP(re)->ptr->options |= RE_OPTION_IGNORECASE;
+ need_recompile = 1;
+ }
+ if (!ruby_ignorecase && state) {
+ FL_UNSET(re, REG_CASESTATE);
+ RREGEXP(re)->ptr->options &= ~RE_OPTION_IGNORECASE;
+ need_recompile = 1;
}
if (!FL_TEST(re, KCODE_FIXED) &&
View
4 version.h
@@ -1,4 +1,4 @@
#define RUBY_VERSION "1.5.4"
-#define RUBY_RELEASE_DATE "2000-06-12"
+#define RUBY_RELEASE_DATE "2000-06-13"
#define RUBY_VERSION_CODE 154
-#define RUBY_RELEASE_CODE 20000612
+#define RUBY_RELEASE_CODE 20000613
Please sign in to comment.
Something went wrong with that request. Please try again.