Changeset 9790


Ignore:
Timestamp:
Jun 19, 2008, 8:42:10 AM (11 years ago)
Author:
gb
Message:

Ensure that GET-USER-HOME-DIR actually does return NIL on failure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/level-1/linux-files.lisp

    r9179 r9790  
    514514environment variable. Returns NIL if there is no user with the ID uid."
    515515  (rlet ((pwd :passwd)
    516          (result :address))
     516         (result :address pwd))
    517517    (do* ((buflen 512 (* 2 buflen)))
    518518         ()
     
    520520        (let* ((err (#_getpwuid_r userid pwd buf buflen result)))
    521521          (if (eql 0 err)
    522             (return (get-foreign-namestring (pref pwd :passwd.pw_dir)))
     522            (return (let* ((rp (%get-ptr result)))
     523                      (unless (%null-ptr-p rp)
     524                        (get-foreign-namestring (pref rp :passwd.pw_dir)))))
    523525            (unless (eql err #$ERANGE)
    524526              (return nil))))))))
Note: See TracChangeset for help on using the changeset viewer.