Changeset 70d7795 for ipc.c


Ignore:
Timestamp:
2010-11-12T22:51:39Z (9 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
ed0589c
Parents:
6da18ac
Message:

Don't use the fd passing code in ipc.c on SunOS since it doesn't seem to be
supported there.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ipc.c

    r6da18ac r70d7795  
    3838static void ipc_master_takeover_fail( struct bitlbee_child *child, gboolean both );
    3939static gboolean ipc_send_fd( int fd, int send_fd );
     40
     41/* On Solaris and possibly other systems passing FDs between processes is
     42 * not possible (or at least not using the method used in this file.
     43 * Just disable that code, the functionality is not that important. */
     44#if defined(NO_FD_PASSING) && !defined(CMSG_SPACE)
     45#define CMSG_SPACE(len) 1
     46#endif
    4047
    4148static void ipc_master_cmd_client( irc_t *data, char **cmd )
     
    446453        if( global.conf->runmode == RUNMODE_FORKDAEMON )
    447454        {
     455#ifndef NO_FD_PASSING
    448456                if( !ipc_send_fd( global.listen_socket, irc->fd ) )
    449457                        ipc_child_disable();
    450458       
    451459                ipc_to_master_str( "IDENTIFY %s :%s\r\n", irc->user->nick, irc->password );
     460#endif
    452461               
    453462                return TRUE;
     
    566575        msg.msg_iov = &iov;
    567576        msg.msg_iovlen = 1;
     577#ifndef NO_FD_PASSING
    568578        msg.msg_control = ccmsg;
    569579        msg.msg_controllen = sizeof( ccmsg );
     580#endif
    570581       
    571582        if( recvmsg( fd, &msg, 0 ) != size )
    572583                return NULL;
    573584       
     585#ifndef NO_FD_PASSING
    574586        if( recv_fd )
    575587                for( cmsg = CMSG_FIRSTHDR( &msg ); cmsg; cmsg = CMSG_NXTHDR( &msg, cmsg ) )
     
    586598                                */
    587599                        }
     600#endif
    588601       
    589602        /*
     
    758771        msg.msg_iovlen = 1;
    759772       
     773#ifndef NO_FD_PASSING
    760774        msg.msg_control = ccmsg;
    761775        msg.msg_controllen = sizeof( ccmsg );
     
    766780        *(int*)CMSG_DATA( cmsg ) = send_fd;
    767781        msg.msg_controllen = cmsg->cmsg_len;
     782#endif
    768783       
    769784        return sendmsg( fd, &msg, 0 ) == 6;
Note: See TracChangeset for help on using the changeset viewer.