errno errors reported as such.

master
Luka Vandervelden 2019-06-10 00:38:54 +02:00
parent 38329bb15e
commit 15aa28ea86
1 changed files with 4 additions and 7 deletions

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