Fix 64-bit build.

A warning about signed vs unsigned comparison was converted
into an error here :

 ...
 struct stat st;
 if (st.st_size > sizeof(prop_area) {
 ...

st_size is either an off64_t, which is a signed type. It's
worth investigating why this didn't trigger a warning on 32 bit,
where it's signed as well.

Change-Id: Ib2622bd5c444ddcfa7fb2141f00332cbb4a0818b
This commit is contained in:
Narayan Kamath
2014-02-24 11:05:02 +00:00
parent c6d96bb867
commit 37e9570bce

View File

@@ -238,7 +238,7 @@ static int map_fd_ro(const int fd) {
if ((fd_stat.st_uid != 0)
|| (fd_stat.st_gid != 0)
|| ((fd_stat.st_mode & (S_IWGRP | S_IWOTH)) != 0)
|| (fd_stat.st_size < sizeof(prop_area)) ) {
|| (fd_stat.st_size < static_cast<off_t>(sizeof(prop_area))) ) {
return -1;
}