errno errors reported as such.

This commit is contained in:
Luka Vandervelden 2019-06-10 00:38:54 +02:00
parent 38329bb15e
commit 15aa28ea86

View File

@ -25,14 +25,11 @@ module System
passwd = pointer.value
# FIXME: Probably should get some errno magic right now.
if 0 != LibC.setuid passwd.pw_uid
raise Exception.new "setuid failed"
end
r = LibC.setgid passwd.pw_gid
raise Errno.new "setgid" if r != 0
if 0 != LibC.setgid passwd.pw_gid
raise Exception.new "setuid failed"
end
r = LibC.setuid passwd.pw_uid
raise Errno.new "setuid" if r != 0
passwd
end