Simplify personality checks in msghdr.c and signal.c

* msghdr.c: Check for [!current_wordsize] instead
of [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4].
* signal.c: Likewise.
This commit is contained in:
Дмитрий Левин 2016-12-26 20:21:23 +00:00
parent 19de67d239
commit 835fb3c5f2
2 changed files with 10 additions and 10 deletions

View File

@ -39,7 +39,7 @@
#include "xlat/scmvals.h"
#include "xlat/ip_cmsg_types.h"
#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
#ifndef current_wordsize
struct cmsghdr32 {
uint32_t cmsg_len;
int cmsg_level;
@ -50,7 +50,7 @@ struct cmsghdr32 {
typedef union {
char *ptr;
struct cmsghdr *cmsg;
#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
#ifndef current_wordsize
struct cmsghdr32 *cmsg32;
#endif
} union_cmsghdr;
@ -260,7 +260,7 @@ decode_msg_control(struct tcb *const tcp, const kernel_ulong_t addr,
tprints(", msg_control=");
const unsigned int cmsg_size =
#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
#ifndef current_wordsize
(current_wordsize < sizeof(long)) ? sizeof(struct cmsghdr32) :
#endif
sizeof(struct cmsghdr);
@ -280,17 +280,17 @@ decode_msg_control(struct tcb *const tcp, const kernel_ulong_t addr,
tprints("[");
while (buf_len >= cmsg_size) {
const kernel_ulong_t cmsg_len =
#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
#ifndef current_wordsize
(current_wordsize < sizeof(long)) ? u.cmsg32->cmsg_len :
#endif
u.cmsg->cmsg_len;
const int cmsg_level =
#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
#ifndef current_wordsize
(current_wordsize < sizeof(long)) ? u.cmsg32->cmsg_level :
#endif
u.cmsg->cmsg_level;
const int cmsg_type =
#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
#ifndef current_wordsize
(current_wordsize < sizeof(long)) ? u.cmsg32->cmsg_type :
#endif
u.cmsg->cmsg_type;

View File

@ -310,8 +310,8 @@ decode_old_sigaction(struct tcb *const tcp, const kernel_ulong_t addr)
{
struct old_sigaction sa;
#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
if (current_wordsize != sizeof(sa.sa_handler__) && current_wordsize == 4) {
#ifndef current_wordsize
if (current_wordsize < sizeof(sa.sa_handler__)) {
struct old_sigaction32 sa32;
if (umove_or_printaddr(tcp, addr, &sa32))
@ -501,8 +501,8 @@ decode_new_sigaction(struct tcb *const tcp, const kernel_ulong_t addr)
{
struct new_sigaction sa;
#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
if (current_wordsize != sizeof(sa.sa_flags) && current_wordsize == 4) {
#ifndef current_wordsize
if (current_wordsize < sizeof(sa.sa_handler__)) {
struct new_sigaction32 sa32;
if (umove_or_printaddr(tcp, addr, &sa32))