From: Kern Sibbald Date: Wed, 19 Aug 2009 20:26:41 +0000 (+0200) Subject: Fix bat crash due to alignment diff in bat and core code X-Git-Tag: Release-5.0.0~332^2~14 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=262a5d00dac487477dc87b0337b684e42a51728a;p=bacula%2Fbacula Fix bat crash due to alignment diff in bat and core code --- diff --git a/bacula/src/lib/bsock.h b/bacula/src/lib/bsock.h index 996ce4973e..dc814a72f3 100644 --- a/bacula/src/lib/bsock.h +++ b/bacula/src/lib/bsock.h @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2008 Free Software Foundation Europe e.V. + Copyright (C) 2000-2009 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -51,6 +51,31 @@ void stop_bsock_timer(btimer_t *wid); class BSOCK { +/* + * Note, keep this public part before the private otherwise + * bat breaks on some systems such as RedHat. + */ +public: + uint64_t read_seqno; /* read sequence number */ + POOLMEM *msg; /* message pool buffer */ + POOLMEM *errmsg; /* edited error message */ + RES *res; /* Resource to which we are connected */ + FILE *m_spool_fd; /* spooling file */ + TLS_CONNECTION *tls; /* associated tls connection */ + IPADDR *src_addr; /* IP address to source connections from */ + uint32_t in_msg_no; /* input message number */ + uint32_t out_msg_no; /* output message number */ + int32_t msglen; /* message length */ + volatile time_t timer_start; /* time started read/write */ + volatile time_t timeout; /* timeout BSOCK after this interval */ + struct sockaddr client_addr; /* client's IP address */ + struct sockaddr_in peer_addr; /* peer's IP address */ + int m_fd; /* socket file descriptor */ + int b_errno; /* bsock errno */ + int m_blocking; /* blocking state (0 = nonblocking, 1 = blocking) */ + volatile int errors; /* incremented for each error on socket */ + volatile bool m_suppress_error_msgs; /* set to suppress error messages */ + private: BSOCK *m_next; /* next BSOCK if duped */ JCR *m_jcr; /* jcr or NULL for error msgs */ @@ -72,26 +97,6 @@ private: int port, utime_t heart_beat, int *fatal); public: - uint64_t read_seqno; /* read sequence number */ - uint32_t in_msg_no; /* input message number */ - uint32_t out_msg_no; /* output message number */ - int m_fd; /* socket file descriptor */ - TLS_CONNECTION *tls; /* associated tls connection */ - int32_t msglen; /* message length */ - int b_errno; /* bsock errno */ - int m_blocking; /* blocking state (0 = nonblocking, 1 = blocking) */ - volatile int errors; /* incremented for each error on socket */ - volatile bool m_suppress_error_msgs: 1; /* set to suppress error messages */ - volatile time_t timer_start; /* time started read/write */ - volatile time_t timeout; /* timeout BSOCK after this interval */ - POOLMEM *msg; /* message pool buffer */ - POOLMEM *errmsg; /* edited error message */ - RES *res; /* Resource to which we are connected */ - FILE *m_spool_fd; /* spooling file */ - struct sockaddr client_addr; /* client's IP address */ - struct sockaddr_in peer_addr; /* peer's IP address */ - IPADDR *src_addr; /* IP address to source connections from */ - /* methods -- in bsock.c */ void init(); void free_bsock(); diff --git a/bacula/technotes b/bacula/technotes index 5a72b91f8e..49f4132265 100644 --- a/bacula/technotes +++ b/bacula/technotes @@ -3,6 +3,8 @@ General: 19Aug09 +kes Fix bat crash due to alignment diff in bat and core code + In bsock.h, exact reason unknown. kes Ensure timestamp put in SQL log 15Aug09 kes Modify acquire alogrithm so jobs do not block during despooling