id: don't call getcon unnecessarily
commitc8b8279d2bd9ed1005ebbcca018446d3a245b97c
authorJim Meyering <meyering@redhat.com>
Fri, 27 Apr 2012 19:24:03 +0000 (27 21:24 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 27 Apr 2012 21:00:55 +0000 (27 23:00 +0200)
treeeac81bce0d8daa50d906be42eeb0287a8f0b036f
parenta6719d9f7252bbd85eaab840a61dfc93d57b05c5
id: don't call getcon unnecessarily

* src/id.c (main): Invocations like "id" and "id -G" would call getcon
to determine the current security context even though that result would
not be used.  Similarly, when POSIXLY_CORRECT is set.  Rearrange
conditionals and hoist the POSIXLY_CORRECT test so that we call
getcon only when necessary.
src/id.c