const char * token_name(int token);
/* generic fifo routines for structs linked by 1st member */
-void *append_gen_fifo(void *fifo, void *entry);
-void *concat_gen_fifos(void *first, void *second);
+void check_gen_fifo_consistency(void *fifo);
+void* append_gen_fifo(void *fifo, void *entry);
+void * concat_gen_fifos(void *first, void *second);
#define APPEND_G_FIFO(pf, pe) \
((pf) = append_gen_fifo((pf), (pe)))
#define CONCAT_G_FIFOS(first, second) \
(void)isc_condition_destroy(&manager->work_available);
isc_mem_free(manager->mctx, manager->threads);
#endif /* ISC_PLATFORM_USETHREADS */
- DESTROYLOCK(&manager->lock);
manager->magic = 0;
+ DESTROYLOCK(&manager->lock);
mctx = manager->mctx;
isc_mem_put(mctx, manager, sizeof(*manager));
isc_mem_detach(&mctx);
continue;
if (!strncmp(cc, "IDEV", (size_t) 4)) {
- sscanf(ca, "%s", ab);
+ sscanf(ca, "%99s", ab);
strncpy(cf_i_dev, ab, sizeof(cf_i_dev));
printf("idev <%s>\n", ab);
} else if (!strncmp(cc, "CDEV", (size_t) 4)) {
- sscanf(ca, "%s", ab);
+ sscanf(ca, "%99s", ab);
strncpy(cf_c_dev, ab, sizeof(cf_c_dev));
printf("cdev <%s>\n", ab);
} else if (!strncmp(cc, "AGC", (size_t) 3)) {
- sscanf(ca, "%s", ab);
+ sscanf(ca, "%99s", ab);
strncpy(cf_agc, ab, sizeof(cf_agc));
printf("agc <%s> %d\n", ab, i);
} else if (!strncmp(cc, "MONITOR", (size_t) 7)) {
- sscanf(ca, "%s", ab);
+ sscanf(ca, "%99s", ab);
strncpy(cf_monitor, ab, sizeof(cf_monitor));
printf("monitor <%s> %d\n", ab, mixer_name(ab, -1));
}
{
blocking_pipe_header * threadcopy;
- DEBUG_REQUIRE(hdr != NULL);
- DEBUG_REQUIRE(hdr->octets > sizeof(*hdr));
- DEBUG_REQUIRE(data != NULL);
+ REQUIRE(hdr != NULL);
+ REQUIRE(hdr->octets > sizeof(*hdr));
+ REQUIRE(data != NULL);
DEBUG_REQUIRE(BLOCKING_REQ_MAGIC == hdr->magic_sig);
ensure_workitems_empty_slot(c);
/* generic fifo routines for structs linked by 1st member */
#ifdef NTP_DEBUG_LISTS_H
void
-check_gen_fifo_consistency(void *pfv)
+check_gen_fifo_consistency(void *fifo)
{
gen_fifo *pf;
gen_node *pthis;
gen_node **pptail;
- pf = pfv;
+ pf = fifo;
REQUIRE((NULL == pf->phead && NULL == pf->pptail) ||
(NULL != pf->phead && NULL != pf->pptail));
*
* ln -s server:port /dev/gps1
*/
- char buffer[80];
+ char buffer[PATH_MAX];
char *nmea_host, *nmea_tail;
u_long nmea_port;
int len;
struct addrinfo *ai;
int rc;
- if ((len = readlink(device,buffer,sizeof(buffer))) == -1)
- return(0);
- buffer[len] = 0;
+ len = readlink(device, buffer, sizeof(buffer) - 1);
+ if (-1 == len)
+ return 0;
+ buffer[len] = '\0';
if ((nmea_host = strtok(buffer,":")) == NULL)
- return(0);
+ return 0;
if ((nmea_tail = strtok(NULL,":")) == NULL)
- return(0);
+ return 0;
if (!atouint(nmea_tail, &nmea_port) ||
nmea_port > USHRT_MAX)
return 0;
freeaddrinfo(ai);
return 0;
}
+ /* blocking connect also naughty, see above. */
rc = connect(fd, ai->ai_addr, ai->ai_addrlen);
freeaddrinfo(ai);
if (-1 == rc) {