* error.c, thread_pthread.c (WRITE_CONST): suppress warnings

`ignoring return value'.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2011-06-30 23:03:23 +00:00
Родитель fa4514e4fe
Коммит 8ad06e2604
3 изменённых файлов: 14 добавлений и 7 удалений

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

@ -1,3 +1,8 @@
Fri Jul 1 08:03:15 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* error.c, thread_pthread.c (WRITE_CONST): suppress warnings
`ignoring return value'.
Fri Jul 1 06:41:36 2011 Koichi Sasada <ko1@atdot.net>
* thread.c (rb_threadptr_check_signal): only wake up main thread.

12
error.c
Просмотреть файл

@ -295,12 +295,14 @@ rb_bug_errno(const char *mesg, int errno_arg)
* this is safe to call inside signal handler and timer thread
* (which isn't a Ruby Thread object)
*/
#define WRITE_CONST(fd,str) write((fd),(str),sizeof(str) - 1)
#define write_or_abort(fd, str, len) (write((fd), (str), (len)) < 0 ? abort() : (void)0)
#define WRITE_CONST(fd,str) write_or_abort((fd),(str),sizeof(str) - 1)
void rb_async_bug_errno(const char *mesg, int errno_arg)
void
rb_async_bug_errno(const char *mesg, int errno_arg)
{
WRITE_CONST(2, "[ASYNC BUG] ");
write(2, mesg, strlen(mesg));
write_or_abort(2, mesg, strlen(mesg));
WRITE_CONST(2, "\n");
if (errno_arg == 0) {
@ -311,10 +313,10 @@ void rb_async_bug_errno(const char *mesg, int errno_arg)
if (!errno_str)
errno_str = "undefined errno";
write(2, errno_str, strlen(errno_str));
write_or_abort(2, errno_str, strlen(errno_str));
}
WRITE_CONST(2, "\n\n");
write(2, ruby_description, strlen(ruby_description));
write_or_abort(2, ruby_description, strlen(ruby_description));
WRITE_CONST(2, "\n\n");
WRITE_CONST(2, REPORTBUG_MSG);
abort();

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

@ -994,7 +994,7 @@ static int timer_thread_pipe_owner_process;
#define TT_DEBUG 0
#define WRITE_CONST(fd, str) write((fd),(str),sizeof(str)-1);
#define WRITE_CONST(fd, str) (void)(write((fd),(str),sizeof(str)-1)<0)
/* only use signal-safe system calls here */
void