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

* eval.c: remove TMP_PROTECT_END to prevent C_ALLOCA crash.

* file.c (rb_file_flock): do not trap EINTR.

* missing/flock.c (flock): returns the value from lockf(2)
  directly.

* eval.c (ev_const_defined): should ignore toplevel cbase (Object).

* eval.c (ev_const_get): ditto.

* ext/md5/md5.h: replace by independent md5 implementation
  contributed by L. Peter Deutsch (thanks).

* ext/md5/md5init.c: adopted to Deutsch's md5 implementation.

* pack.c (pack_unpack): string from P/p should be tainted.

* ext/curses/curses.c: curses on Mac OS X public beta does not
  have _maxx etc.

* marshal.c (w_object): should truncate trailing zero short for
  bignums.

* object.c (sym_intern): new method.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2001-03-26 08:57:16 +00:00
parent 44f754bd87
commit de51a663b4
14 changed files with 572 additions and 489 deletions

View file

@ -94,7 +94,6 @@ flock(fd, operation)
int fd;
int operation;
{
int i;
switch (operation) {
/* LOCK_SH - get a shared lock */
@ -103,8 +102,7 @@ flock(fd, operation)
return -1;
/* LOCK_EX - get an exclusive lock */
case LOCK_EX:
i = lockf (fd, F_LOCK, 0);
break;
return lockf (fd, F_LOCK, 0);
/* LOCK_SH|LOCK_NB - get a non-blocking shared lock */
case LOCK_SH|LOCK_NB:
@ -112,24 +110,17 @@ flock(fd, operation)
return -1;
/* LOCK_EX|LOCK_NB - get a non-blocking exclusive lock */
case LOCK_EX|LOCK_NB:
i = lockf (fd, F_TLOCK, 0);
if (i == -1)
if ((errno == EAGAIN) || (errno == EACCES))
errno = EWOULDBLOCK;
break;
return lockf (fd, F_TLOCK, 0);
/* LOCK_UN - unlock */
case LOCK_UN:
i = lockf (fd, F_ULOCK, 0);
break;
return lockf (fd, F_ULOCK, 0);
/* Default - can't decipher operation */
default:
i = -1;
errno = EINVAL;
break;
return -1;
}
return i;
}
#elif !defined NT
int