QIOChannelSocket *ioc = QIO_CHANNEL_SOCKET(obj);
if (ioc->fd != -1) {
- if (QIO_CHANNEL(ioc)->features & (1 << QIO_CHANNEL_FEATURE_LISTEN)) {
+ QIOChannel *ioc_local = QIO_CHANNEL(ioc);
+ if (qio_channel_has_feature(ioc_local, QIO_CHANNEL_FEATURE_LISTEN)) {
Error *err = NULL;
socket_listen_cleanup(ioc->fd, &err);
ioc = QIO_CHANNEL(tioc);
tioc->master = master;
- if (master->features & (1 << QIO_CHANNEL_FEATURE_SHUTDOWN)) {
+ if (qio_channel_has_feature(master, QIO_CHANNEL_FEATURE_SHUTDOWN)) {
ioc->features |= (1 << QIO_CHANNEL_FEATURE_SHUTDOWN);
}
object_ref(OBJECT(master));
ioc = QIO_CHANNEL(wioc);
wioc->master = master;
- if (master->features & (1 << QIO_CHANNEL_FEATURE_SHUTDOWN)) {
+ if (qio_channel_has_feature(master, QIO_CHANNEL_FEATURE_SHUTDOWN)) {
ioc->features |= (1 << QIO_CHANNEL_FEATURE_SHUTDOWN);
}
object_ref(OBJECT(master));
QIOChannelClass *klass = QIO_CHANNEL_GET_CLASS(ioc);
if ((fds || nfds) &&
- !(ioc->features & (1 << QIO_CHANNEL_FEATURE_FD_PASS))) {
+ !qio_channel_has_feature(ioc, QIO_CHANNEL_FEATURE_FD_PASS)) {
error_setg_errno(errp, EINVAL,
"Channel does not support file descriptor passing");
return -1;
QIOChannelClass *klass = QIO_CHANNEL_GET_CLASS(ioc);
if ((fds || nfds) &&
- !(ioc->features & (1 << QIO_CHANNEL_FEATURE_FD_PASS))) {
+ !qio_channel_has_feature(ioc, QIO_CHANNEL_FEATURE_FD_PASS)) {
error_setg_errno(errp, EINVAL,
"Channel does not support file descriptor passing");
return -1;