From ce5fe51a2146632402462dce7034530b2fd11c7a Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Mon, 28 May 2012 15:44:38 +0200 Subject: [PATCH] Align conio.c struct at 8 bytes to fix Sparc bus error. --- bacula/src/console/conio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bacula/src/console/conio.c b/bacula/src/console/conio.c index 8165444f2c..eb6684b599 100755 --- a/bacula/src/console/conio.c +++ b/bacula/src/console/conio.c @@ -146,9 +146,9 @@ static char *kE; /* end */ */ typedef struct s_stab { struct s_stab *next; + char *str; int len; int func; - char *str; } stab_t; #define MAX_STAB 30 @@ -871,13 +871,13 @@ putline(char *newl, int newlen) nptr->nextl->prevl = lptr; lptr->len += nptr->len; } - if (lptr->len > newlen + 2 * PHDRL) { /* split buffer */ + if (lptr->len > newlen + 2 * PHDRL + 7) { /* split buffer */ nptr = (struct lstr *)((char *)lptr + newlen + PHDRL); - /* Appropriate byte alignment - normally 2 byte, but on - sparc we need 4 byte alignment, so we always do 4 */ - if (((long unsigned)nptr & 3) != 0) { /* test four byte alignment */ + /* Appropriate byte alignment - for Intel 2 byte, but on + Sparc we need 8 byte alignment, so we always do 8 */ + if (((long unsigned)nptr & 7) != 0) { /* test four byte alignment */ p = (char *)nptr; - nptr = (struct lstr *)((((long unsigned) p) & ~3) + 4); + nptr = (struct lstr *)((((long unsigned) p) & ~7) + 8); } nptr->len = lptr->len - ((char *)nptr - (char *)lptr); lptr->len -= nptr->len; -- 2.39.5