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
225 225

  
226 226
		tlen = strftime(tstr, sizeof(tstr), KNOT_LOG_TIME_FORMAT " ", &lt);
227 227

  
228
#if !defined(__sun__)
228 229
		if (precise && tlen > 0) {
229 230
			char pm = (lt.tm_gmtoff > 0) ? '+' : '-';
230 231
			snprintf(tstr + tlen - 1, sizeof(tstr) - tlen + 1,
......
233 234
			         (unsigned int)lt.tm_gmtoff / 3600,
234 235
			         (unsigned int)(lt.tm_gmtoff / 60) % 60);
235 236
		}
237
#endif
236 238
	}
237 239

  
238 240
	// Log streams
239
-- knot-1.4.4.orig/src/knot/stat/stat.h
241
++ knot-1.4.4/src/knot/stat/stat.h
......
58 58
struct stat_stat {
59 59
//	struct timespec t1, t2; /* Currently disabled */
60 60
	protocol_t protocol; /*!< Flags. */
61
	struct sockaddr_in *s_addr;
61
	struct sockaddr_in *xs_addr;
62 62
//  gatherer_t *gatherer; / * not needed when using static gatherer. */
63 63
};
64 64

  
......
94 94
 * \brief Gets the time from a processing function.
95 95
 *
96 96
 * \param stat  Current instance of stat_t.
97
 * \param s_addr Sockaddr structure to be used later for statistics.
97
 * \param xs_addr Sockaddr structure to be used later for statistics.
98 98
 */
99 99
#ifdef STAT_COMPILE
100 100
#warning "stat fixme: pass sockaddr* for generic _in and _in6 support"
101
void stat_get_first(stat_t *stat, struct sockaddr_in *s_addr);
101
void stat_get_first(stat_t *stat, struct sockaddr_in *xs_addr);
102 102
#else
103
static inline void stat_get_first(stat_t *stat, struct sockaddr *s_addr) {}
103
static inline void stat_get_first(stat_t *stat, struct sockaddr *xs_addr) {}
104 104
#endif /* STAT_COMPILE */
105 105

  
106 106
/*!
107
-- knot-1.4.4.orig/src/libknot/util/endian.h
107
++ knot-1.4.4/src/libknot/util/endian.h
......
46 46
#       define htobe16(x) OSSwapHostToBigInt16(x)
47 47
#       define htobe32(x) OSSwapHostToBigInt32(x)
48 48
#       define htobe64(x) OSSwapHostToBigInt64(x)
49
#elif defined(__sun__)
50
#	include <byteswap.h>
51
#  if BYTE_ORDER == LITTLE_ENDIAN
52
#       define be16toh(x) bswap_16 (x)
53
#       define be32toh(x) bswap_32 (x)
54
#       define be64toh(x) bswap_64 (x)
55
#       define htobe16(x) bswap_16 (x)
56
#       define htobe32(x) bswap_32 (x)
57
#       define htobe64(x) bswap_64 (x)
58
# else
59
#       define be16toh(x) (x)
60
#       define be32toh(x) (x)
61
#       define be64toh(x) (x)
62
#       define htobe16(x) (x)
63
#       define htobe32(x) (x)
64
#       define htobe64(x) (x)
65
# endif
49 66
#endif
50 67

  
51 68
#endif /* _KNOT_ENDIAN_H_ */
    (1-1/1)