зеркало из https://github.com/github/ruby.git
* process.c (rb_fork_err): suppress gcc 4.4 warnings.
* random.c (fill_random_seed): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
9a8440e5d4
Коммит
52aa6ab21d
|
@ -1,3 +1,9 @@
|
|||
Tue Jul 13 21:28:35 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* process.c (rb_fork_err): suppress gcc 4.4 warnings.
|
||||
|
||||
* random.c (fill_random_seed): ditto.
|
||||
|
||||
Tue Jul 13 21:01:44 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/pty/pty.c (establishShell): chfunc must not raise any
|
||||
|
|
|
@ -2513,10 +2513,12 @@ rb_fork_err(int *status, int (*chfunc)(void*, char *, size_t), void *charg, VALU
|
|||
if (!(*chfunc)(charg, errmsg, errmsg_buflen)) _exit(EXIT_SUCCESS);
|
||||
#ifdef FD_CLOEXEC
|
||||
err = errno;
|
||||
(void)write(ep[1], &err, sizeof(err));
|
||||
if (write(ep[1], &err, sizeof(err)) < 0) err = errno;
|
||||
if (errmsg && 0 < errmsg_buflen) {
|
||||
errmsg[errmsg_buflen-1] = '\0';
|
||||
(void)write(ep[1], errmsg, strlen(errmsg));
|
||||
errmsg_buflen = strlen(errmsg);
|
||||
if (errmsg_buflen > 0 &&write(ep[1], errmsg, errmsg_buflen) < 0)
|
||||
err = errno;
|
||||
}
|
||||
#endif
|
||||
#if EXIT_SUCCESS == 127
|
||||
|
|
4
random.c
4
random.c
|
@ -489,7 +489,9 @@ fill_random_seed(unsigned int seed[DEFAULT_SEED_CNT])
|
|||
#endif
|
||||
)) >= 0) {
|
||||
if (fstat(fd, &statbuf) == 0 && S_ISCHR(statbuf.st_mode)) {
|
||||
(void)read(fd, seed, DEFAULT_SEED_LEN);
|
||||
if (read(fd, seed, DEFAULT_SEED_LEN) < DEFAULT_SEED_LEN) {
|
||||
/* abandon */;
|
||||
}
|
||||
}
|
||||
close(fd);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче