X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fxcb_util.c;h=ad9b3df7c9e693112ad9f922a3d67c7d072d7b74;hb=4b502dd696cf7f59a961bcf71c9255ae28f0765a;hp=0e3728a53f08f6acd6a7a57c2e6c712083c45a94;hpb=20da10490f8dac75ec9fe1df28cb9e862e171be5;p=free-sw%2Fxcb%2Flibxcb diff --git a/src/xcb_util.c b/src/xcb_util.c index 0e3728a..ad9b3df 100644 --- a/src/xcb_util.c +++ b/src/xcb_util.c @@ -28,10 +28,6 @@ #include #include #include -#ifdef DNETCONN -#include -#include -#endif #include #include #include @@ -54,7 +50,11 @@ #include "xcbext.h" #include "xcbint.h" -static const int error_connection = 1; +/* must be after "xcbint.h" to get autoconf #defines */ +#if defined(HAVE_TSOL_LABEL_H) && defined(HAVE_IS_SYSTEM_LABELED) +# include +# include +#endif int xcb_popcount(uint32_t mask) { @@ -64,6 +64,16 @@ int xcb_popcount(uint32_t mask) return ((y + (y >> 3)) & 030707070707) % 077; } +int xcb_sumof(uint8_t *list, int len) +{ + int i, s = 0; + for(i=0; in_length; - memcpy(addr.sdn_add.a_addr, nodeaddr->n_addr, addr.sdn_add.a_len); - - addr.sdn_objnamel = sprintf((char *)addr.sdn_objname, "X$X%d", port); - if(addr.sdn_objnamel < 0) - return -1; - addr.sdn_objnum = 0; - - fd = _xcb_socket(PF_DECnet, SOCK_STREAM, 0); - if(fd == -1) - return -1; - - memset(&accessdata, 0, sizeof(accessdata)); - accessdata.acc_accl = sprintf((char*)accessdata.acc_acc, "%d", getuid()); - if(accessdata.acc_accl < 0) - return -1; - setsockopt(fd, DNPROTO_NSP, SO_CONACCESS, &accessdata, sizeof(accessdata)); - - if(connect(fd, (struct sockaddr *) &addr, sizeof(addr)) == -1) { - close(fd); - return -1; - } - return fd; -} -#endif static int _xcb_open_tcp(const char *host, char *protocol, const unsigned short port) {