cds_list_for_each_entry(iter, &kconsumerd_data.fd_list.head, list) {
if (iter->sessiond_fd == fd) {
DBG("Duplicate session fd %d", fd);
cds_list_for_each_entry(iter, &kconsumerd_data.fd_list.head, list) {
if (iter->sessiond_fd == fd) {
DBG("Duplicate session fd %d", fd);
tmp_fd->state = buf->state;
tmp_fd->max_sb_size = buf->max_sb_size;
strncpy(tmp_fd->path_name, buf->path_name, PATH_MAX);
tmp_fd->state = buf->state;
tmp_fd->max_sb_size = buf->max_sb_size;
strncpy(tmp_fd->path_name, buf->path_name, PATH_MAX);
/* Opening the tracefile in write mode */
ret = open(tmp_fd->path_name,
/* Opening the tracefile in write mode */
ret = open(tmp_fd->path_name,
struct pollfd *kconsumerd_sockpoll, int size,
enum kconsumerd_command cmd_type)
{
struct pollfd *kconsumerd_sockpoll, int size,
enum kconsumerd_command cmd_type)
{
/* the number of fds we are about to receive */
nb_fd = size / sizeof(struct lttcomm_kconsumerd_msg);
/* the number of fds we are about to receive */
nb_fd = size / sizeof(struct lttcomm_kconsumerd_msg);
- DBG("kconsumerd_add_fd %s (%d)", lkm.path_name, (CMSG_DATA(cmsg)[0]));
- ret = kconsumerd_add_fd(&lkm, (CMSG_DATA(cmsg)[0]));
+ DBG("kconsumerd_add_fd %s (%d)", lkm.path_name, ((int *) CMSG_DATA(cmsg))[0]);
+ ret = kconsumerd_add_fd(&lkm, ((int *) CMSG_DATA(cmsg))[0]);
* running (after joining on the threads), no need to protect
* list iteration with mutex.
*/
* running (after joining on the threads), no need to protect
* list iteration with mutex.
*/
- cds_list_for_each_entry(iter, &kconsumerd_data.fd_list.head, list) {
+ cds_list_for_each_entry_safe(iter, tmp, &kconsumerd_data.fd_list.head, list) {