summaryrefslogtreecommitdiff
path: root/ext/pty/pty.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-05 08:10:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-05 08:10:34 +0000
commit7f23534b1fdc374a94e0a1fe09911154c14ed9f8 (patch)
treea03903287c2d67ca653c8bb20bc14e2741c1ada0 /ext/pty/pty.c
parentb2f7e64caf2e2ed31ebc28f3dd01726f98258c8a (diff)
pty.c: check error of seteuid
* ext/pty/pty.c (chfunc): check error of seteuid and return error message, to suppress unused-value warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/pty/pty.c')
-rw-r--r--ext/pty/pty.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index 20b2cc0..4ba1cba 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -144,7 +144,7 @@ chfunc(void *data, char *errbuf, size_t errbuf_len)
dup2(slave,2);
close(slave);
#if defined(HAVE_SETEUID) || defined(HAVE_SETREUID) || defined(HAVE_SETRESUID)
- seteuid(getuid());
+ if (seteuid(getuid())) ERROR_EXIT("seteuid()");
#endif
return rb_exec_async_signal_safe(carg->eargp, errbuf, sizeof(errbuf_len));