Raymond Toy pushed to branch issue-381-cmucl-unix-os-specific at cmucl / cmucl

Commits:

2 changed files:

Changes:

  • src/code/unix.lisp
    ... ... @@ -2559,10 +2559,7 @@
    2559 2559
     
    
    2560 2560
     #+solaris
    
    2561 2561
     (defun unix-getpwuid (uid)
    
    2562
    -  _N"Return a USER-INFO structure for the user identified by UID.  If
    
    2563
    -  not found, NIL is returned with a second value indicating the cause
    
    2564
    -  of the failure.  In particular, if the second value is 0 (or
    
    2565
    -  ENONENT, ESRCH, EBADF, etc.), then the uid was not found."
    
    2562
    +  _N"Return a USER-INFO structure for the user identified by UID, or NIL if not found."
    
    2566 2563
       (declare (type unix-uid uid))
    
    2567 2564
       (with-alien ((buf (array c-call:char 1024))
    
    2568 2565
     	       (user-info (struct passwd)))
    
    ... ... @@ -2592,10 +2589,7 @@
    2592 2589
     
    
    2593 2590
     #+bsd
    
    2594 2591
     (defun unix-getpwuid (uid)
    
    2595
    -  _N"Return a USER-INFO structure for the user identified by UID.  If
    
    2596
    -  not found, NIL is returned with a second value indicating the cause
    
    2597
    -  of the failure.  In particular, if the second value is 0 (or
    
    2598
    -  ENONENT, ESRCH, EBADF, etc.), then the uid was not found."
    
    2592
    +  _N"Return a USER-INFO structure for the user identified by UID, or NIL if not found."
    
    2599 2593
       (declare (type unix-uid uid))
    
    2600 2594
       (let ((result
    
    2601 2595
              (alien-funcall
    
    ... ... @@ -2637,7 +2631,8 @@
    2637 2631
     	    (cast buf (* c-call:char))
    
    2638 2632
     	    1024
    
    2639 2633
                 (addr result))))
    
    2640
    -      (if (not (zerop (sap-int (alien-sap result))))
    
    2634
    +      (if (null-alien result)
    
    2635
    +	  (values nil returned)
    
    2641 2636
               (make-user-info
    
    2642 2637
                :name (string (cast (slot result 'pw-name) c-call:c-string))
    
    2643 2638
                :password (string (cast (slot result 'pw-passwd) c-call:c-string))
    
    ... ... @@ -2645,8 +2640,7 @@
    2645 2640
                :gid (slot result 'pw-gid)
    
    2646 2641
                :gecos (string (cast (slot result 'pw-gecos) c-call:c-string))
    
    2647 2642
                :dir (string (cast (slot result 'pw-dir) c-call:c-string))
    
    2648
    -           :shell (string (cast (slot result 'pw-shell) c-call:c-string)))
    
    2649
    -	  (values nil returned)))))
    
    2643
    +           :shell (string (cast (slot result 'pw-shell) c-call:c-string)))))))
    
    2650 2644
     
    
    2651 2645
     ;;; Getrusage is not provided in the C library on Solaris 2.4, and is
    
    2652 2646
     ;;; rather slow on later versions so the "times" system call is
    

  • src/i18n/locale/cmucl-unix.pot
    ... ... @@ -1346,6 +1346,12 @@ msgid ""
    1346 1346
     "   slots as in unix-getitimer."
    
    1347 1347
     msgstr ""
    
    1348 1348
     
    
    1349
    +#: src/code/unix.lisp
    
    1350
    +msgid ""
    
    1351
    +"Return a USER-INFO structure for the user identified by UID, or NIL if not "
    
    1352
    +"found."
    
    1353
    +msgstr ""
    
    1354
    +
    
    1349 1355
     #: src/code/unix.lisp
    
    1350 1356
     msgid ""
    
    1351 1357
     "Return a USER-INFO structure for the user identified by UID.  If\n"