[yocto] [PATCH] rmc: fix allocating buffer issue in read_file() (32 bit)

Khem Raj raj.khem at gmail.com
Tue Aug 16 17:18:52 PDT 2016


> On Aug 16, 2016, at 4:12 PM, Jianxun Zhang <jianxun.zhang at linux.intel.com> wrote:
> 
> Runtime test script failed on T100TA (32 bit) machine because
> read_file() function in rmc.c gets a wrong value of st_size from
> the buffer returned by stat(). We include rmc header files prior
> to the rest of standard header files in rmc.c, so standard data
> subsequently defined could be affected by "#pragma pack(1)" in rmc
> header files.


perhaps resetting the pragma would make it independent of positioning sequence ?

> 
> Runtime test passes on T100TA and other two boards with this change.
> 
> Signed-off-by: Jianxun Zhang <jianxun.zhang at linux.intel.com>
> ---
> src/rmc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/rmc.c b/src/rmc.c
> index 714ae3a..6cf584e 100644
> --- a/src/rmc.c
> +++ b/src/rmc.c
> @@ -10,8 +10,6 @@
> #include <stdio.h>
> #include <unistd.h>
> #include <ctype.h>
> -#include <rmcl.h>
> -#include <rsmp.h>
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <fcntl.h>
> @@ -20,6 +18,8 @@
> #include <sys/stat.h>
> #include <sys/mman.h>
> 
> +#include <rmcl.h>
> +#include <rsmp.h>
> 
> #define USAGE "RMC (Runtime Machine configuration) Tool\n" \
>     "NOTE: Most of usages require root permission (sudo)\n" \
> --
> 2.7.4
> 
> --
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20160816/9e4a0f80/attachment.pgp>


More information about the yocto mailing list