Changeset 464


Ignore:
Timestamp:
Jun 10, 2010, 12:38:39 PM (15 years ago)
Author:
Silvan Scherrer
Message:

Samba Server 3.5: changed pipe() to socketpair()

Location:
trunk/server
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/lib/tevent/tevent_signal.c

    r429 r464  
    3030#include "tevent_internal.h"
    3131#include "tevent_util.h"
     32#ifdef __OS2__
     33#include <sys/socket.h>
     34#endif
    3235
    3336#define TEVENT_NUM_SIGNALS 64
     
    246249           setup */
    247250        if (ev->pipe_fde == NULL) {
     251#ifndef __OS2__
    248252                if (pipe(ev->pipe_fds) == -1) {
     253#else
     254                if (socketpair(AF_UNIX, SOCK_STREAM,0, ev->pipe_fds) == -1) {
     255#endif
    249256                        talloc_free(se);
    250257                        return NULL;
  • trunk/server/lib/tevent/tevent_util.c

    r414 r464  
    2929#include "tevent_util.h"
    3030#include <fcntl.h>
     31#ifdef __OS2__
     32#include <sys/filio.h>
     33#endif
    3134
    3235/**
     
    8285        if((val = fcntl(fd, F_GETFL, 0)) == -1)
    8386                return -1;
     87#ifndef __OS2__
    8488        if(set) /* Turn blocking on - ie. clear nonblock flag */
    8589                val &= ~FLAG_TO_SET;
     
    8791                val |= FLAG_TO_SET;
    8892        return fcntl( fd, F_SETFL, val);
     93#else
     94        if(set) /* turn blocking on - ie. clear nonblock flag */
     95                val = 0;
     96        else
     97                val = 1;
     98        return os2_ioctl(fd, FIONBIO, (char *) &val, sizeof(val));
     99#endif
     100
    89101#undef FLAG_TO_SET
    90102}
  • trunk/server/source3/lib/recvfile.c

    r414 r464  
    174174        }
    175175
     176#ifndef __OS2__
    176177        if ((pipefd[0] == -1) && (pipe(pipefd) == -1)) {
     178#else
     179        if ((pipefd[0] == -1) && (socketpair(AF_UNIX, SOCK_STREAM,0, pipefd) == -1)) {
     180#endif
    177181                try_splice_call = false;
    178182                return default_sys_recvfile(fromfd, tofd, offset, count);
  • trunk/server/source3/printing/print_cups.c

    r429 r464  
    408408        DEBUG(5,("cups_pcap_load_async: asynchronously loading cups printers\n"));
    409409
     410#ifndef __OS2__
    410411        if (pipe(fds) == -1) {
     412#else   // on OS2 we have no select() on pipes, so we use socketpair() instead
     413        if (socketpair(AF_UNIX, SOCK_STREAM,0, fds) == -1) {
     414#endif
    411415                return false;
    412416        }
Note: See TracChangeset for help on using the changeset viewer.