summaryrefslogtreecommitdiff
path: root/setup_native
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-10-27 21:55:52 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-10-27 21:55:52 +0100
commit077ad1a5ab6848255e0350df368c4f45ae73da9c (patch)
tree22543876812af289542615294e73eef1f1de5897 /setup_native
parentf66cbdb948c6c43909a18be10aa838c69338dcb0 (diff)
-Werror,-Wtautological-pointer-compare
(/usr/include/sys/stat.h annotates __lxstat params as __nonnull) Change-Id: I4297c4a05f54bc35688b65dd1ddcdeb7bc7fc37b
Diffstat (limited to 'setup_native')
-rw-r--r--setup_native/scripts/source/getuid.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/setup_native/scripts/source/getuid.c b/setup_native/scripts/source/getuid.c
index 17ed60dc88e9..d3660f4c7f7b 100644
--- a/setup_native/scripts/source/getuid.c
+++ b/setup_native/scripts/source/getuid.c
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <assert.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -122,11 +123,9 @@ int __lxstat(int n, const char *path, struct stat *buf)
p_lstat = (int (*)(int n, const char *path, struct stat *buf))
dlsym (RTLD_NEXT, "__lxstat");
ret = (*p_lstat)(n, path, buf);
- if (buf != NULL)
- {
- buf->st_uid = 0; /* root */
- buf->st_gid = 0; /* root */
- }
+ assert(buf != NULL);
+ buf->st_uid = 0; /* root */
+ buf->st_gid = 0; /* root */
return ret;
}
#else