openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/dbus/1.12.16-r0/dbus-1.12.16/dbus/dbus-sysdeps-unix.c
dbus_bool_t _dbus_socket_can_pass_unix_fd(DBusSocket fd)
{
#ifdef SCM_RIGHTS
    union
    {
        struct sockaddr sa;
        struct sockaddr_storage storage;
        struct sockaddr_un un;
    } sa_buf;

    socklen_t sa_len = sizeof(sa_buf);

    _DBUS_ZERO(sa_buf);

    if (getsockname(fd.fd, &sa_buf.sa, &sa_len) < 0)
        return FALSE;

    return sa_buf.sa.sa_family == AF_UNIX;

#else
    return FALSE;

#endif
}
/**
 *  Checks whether file descriptors may be passed via the socket
 *
 *  @param fd the socket
 *  @return TRUE when fd passing over this socket is supported
 *
 */
Checks whether file descriptors may be passed via the socket
@param fd the socket
@return TRUE when fd passing over this socket is supported
Checks whether file descriptors may be passed via the socket @param fd the socket @return TRUE when fd passing over this socket is supported
dbus_bool_t _dbus_socket_can_pass_unix_fd(DBusSocket fd)
{
#ifdef SCM_RIGHTS
    union
    {
        struct sockaddr sa;
        struct sockaddr_storage storage;
        struct sockaddr_un un;
    } sa_buf;
    socklen_t sa_len = sizeof(sa_buf);
    _DBUS_ZERO(sa_buf);
    if (getsockname(fd.fd, &sa_buf.sa, &sa_len) < 0)
        return FALSE;
    return sa_buf.sa.sa_family == AF_UNIX;
#else
    return FALSE;
#endif
}
dbus_bool_t _dbus_socket_can_pass_unix_fd ( DBusSocket fd ) { #ifdef SCM_RIGHTS union { struct sockaddr sa ; struct sockaddr_storage storage ; struct sockaddr_un un ; } sa_buf ; socklen_t sa_len = sizeof ( sa_buf ) ; _DBUS_ZERO ( sa_buf ) ; if ( getsockname ( fd . fd , & sa_buf . sa , & sa_len ) < 0 ) return FALSE ; return sa_buf . sa . sa_family == AF_UNIX ; #else return FALSE ; #endif }
Checks whether file descriptors may be passed via the socket
  @param fd the socket
  @return TRUE when fd passing over this socket is supported
Checks whether file descriptors may be passed via the socket @param fd the socket @return TRUE when fd passing over this socket is supported