]> git.sur5r.net Git - bacula/bacula/commitdiff
Align conio.c struct at 8 bytes to fix Sparc bus error.
authorKern Sibbald <kern@sibbald.com>
Mon, 28 May 2012 13:44:38 +0000 (15:44 +0200)
committerKern Sibbald <kern@sibbald.com>
Mon, 28 May 2012 13:44:38 +0000 (15:44 +0200)
bacula/src/console/conio.c

index 8165444f2c61f6bfda978a667b83c986e4546000..eb6684b5990ab11fb5d208dfc465d123ae1b8d31 100755 (executable)
@@ -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;