id: handle (uid_t) -1 more portably
commit47e511a1d0ee8c82d6e9014fb6a74ab6dfd89d3d
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 15 Nov 2011 17:30:49 +0000 (15 09:30 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 15 Nov 2011 17:31:21 +0000 (15 09:31 -0800)
treeeb9d463ee0cd44c91bb5d3178505b7f7e5a50f42
parent7db79cc4f802aa39b6e03bbfce12c405381f8398
id: handle (uid_t) -1 more portably

* src/id.c (GETID_MAY_FAIL): Remove.
(main): Check for nonzero errno, rather than having a compile-time
GETID_MAY_FAIL guess.  Suggested by Roland McGrath in
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10021#47>.
Also, the old code was incorrect if uid_t was narrower than int.
(print_full_info): Remove unnecessary cast to -1.
src/id.c