Project

General

Profile

Bug #174 » knot-dyson.patch

add Dyson support to knot - Justin Maggard, 2014-05-24 01:52 AM

View differences:

knot-1.4.4/src/common/log.c
tlen = strftime(tstr, sizeof(tstr), KNOT_LOG_TIME_FORMAT " ", &lt);
#if !defined(__sun__)
if (precise && tlen > 0) {
char pm = (lt.tm_gmtoff > 0) ? '+' : '-';
snprintf(tstr + tlen - 1, sizeof(tstr) - tlen + 1,
......
(unsigned int)lt.tm_gmtoff / 3600,
(unsigned int)(lt.tm_gmtoff / 60) % 60);
}
#endif
}
// Log streams
-- knot-1.4.4.orig/src/knot/stat/stat.h
++ knot-1.4.4/src/knot/stat/stat.h
......
struct stat_stat {
// struct timespec t1, t2; /* Currently disabled */
protocol_t protocol; /*!< Flags. */
struct sockaddr_in *s_addr;
struct sockaddr_in *xs_addr;
// gatherer_t *gatherer; / * not needed when using static gatherer. */
};
......
* \brief Gets the time from a processing function.
*
* \param stat Current instance of stat_t.
* \param s_addr Sockaddr structure to be used later for statistics.
* \param xs_addr Sockaddr structure to be used later for statistics.
*/
#ifdef STAT_COMPILE
#warning "stat fixme: pass sockaddr* for generic _in and _in6 support"
void stat_get_first(stat_t *stat, struct sockaddr_in *s_addr);
void stat_get_first(stat_t *stat, struct sockaddr_in *xs_addr);
#else
static inline void stat_get_first(stat_t *stat, struct sockaddr *s_addr) {}
static inline void stat_get_first(stat_t *stat, struct sockaddr *xs_addr) {}
#endif /* STAT_COMPILE */
/*!
-- knot-1.4.4.orig/src/libknot/util/endian.h
++ knot-1.4.4/src/libknot/util/endian.h
......
# define htobe16(x) OSSwapHostToBigInt16(x)
# define htobe32(x) OSSwapHostToBigInt32(x)
# define htobe64(x) OSSwapHostToBigInt64(x)
#elif defined(__sun__)
# include <byteswap.h>
# if BYTE_ORDER == LITTLE_ENDIAN
# define be16toh(x) bswap_16 (x)
# define be32toh(x) bswap_32 (x)
# define be64toh(x) bswap_64 (x)
# define htobe16(x) bswap_16 (x)
# define htobe32(x) bswap_32 (x)
# define htobe64(x) bswap_64 (x)
# else
# define be16toh(x) (x)
# define be32toh(x) (x)
# define be64toh(x) (x)
# define htobe16(x) (x)
# define htobe32(x) (x)
# define htobe64(x) (x)
# endif
#endif
#endif /* _KNOT_ENDIAN_H_ */
    (1-1/1)