- DBG("Waiting to receive fds");
- if ((ret = recvmsg(sfd, &msg, 0)) < 0) {
- perror("recvmsg");
- }
- if (ret != size) {
- ERR("Received only %d, expected %d", ret, size);
- send_error(KCONSUMERD_ERROR_RECV_FD);
- goto end;
- }
+ if (ret != (size / nb_fd)) {
+ ERR("Received only %d, expected %d", ret, size);
+ send_error(KCONSUMERD_ERROR_RECV_FD);
+ goto end;
+ }