: with-pwent ( quot -- )
setpwent
- [ unix.ffi:endpwent ] [ ] cleanup ; inline
+ [ unix.ffi:endpwent ] finally ; inline
PRIVATE>
: (with-real-user) ( string/id quot -- )
'[ _ set-real-user @ ]
real-user-id '[ _ set-real-user ]
- [ ] cleanup ; inline
+ finally ; inline
: with-real-user ( string/id/f quot -- )
over [ (with-real-user) ] [ nip call ] if ; inline
: (with-effective-user) ( string/id quot -- )
'[ _ set-effective-user @ ]
effective-user-id '[ _ set-effective-user ]
- [ ] cleanup ; inline
+ finally ; inline
: with-effective-user ( string/id/f quot -- )
over [ (with-effective-user) ] [ nip call ] if ; inline