comparison src/channel.c @ 12158:b3e39486880a v8.0.0959

patch 8.0.0959: build failure on MS-Windows commit https://github.com/vim/vim/commit/f66a2cda2c425c441fc5e20c8f8893c9630e3aaa Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 18 21:53:22 2017 +0200 patch 8.0.0959: build failure on MS-Windows Problem: Build failure on MS-Windows. Solution: Use ioctlsocket() instead of fcntl().
author Christian Brabandt <cb@256bit.org>
date Fri, 18 Aug 2017 22:00:04 +0200
parents 71e10b81226d
children 51e5a8602624
comparison
equal deleted inserted replaced
12157:b1b1005905b9 12158:b3e39486880a
3540 } 3540 }
3541 # endif 3541 # endif
3542 3542
3543 /* 3543 /*
3544 * Set "channel"/"part" to non-blocking. 3544 * Set "channel"/"part" to non-blocking.
3545 * Only works for sockets and pipes.
3545 */ 3546 */
3546 void 3547 void
3547 channel_set_nonblock(channel_T *channel, ch_part_T part) 3548 channel_set_nonblock(channel_T *channel, ch_part_T part)
3548 { 3549 {
3549 chanpart_T *ch_part = &channel->ch_part[part]; 3550 chanpart_T *ch_part = &channel->ch_part[part];
3550 int fd = ch_part->ch_fd; 3551 int fd = ch_part->ch_fd;
3551 3552
3552 if (fd != INVALID_FD) 3553 if (fd != INVALID_FD)
3553 { 3554 {
3554 #ifdef _WIN32 3555 #ifdef _WIN32
3555 if (part == PART_SOCK) 3556 u_long val = 1;
3556 { 3557
3557 u_long val = 1; 3558 ioctlsocket(fd, FIONBIO, &val);
3558 3559 #else
3559 ioctlsocket(fd, FIONBIO, &val); 3560 fcntl(fd, F_SETFL, O_NONBLOCK);
3560 }
3561 else
3562 #endif 3561 #endif
3563 fcntl(fd, F_SETFL, O_NONBLOCK);
3564 ch_part->ch_nonblocking = TRUE; 3562 ch_part->ch_nonblocking = TRUE;
3565 } 3563 }
3566 } 3564 }
3567 3565
3568 /* 3566 /*
3704 { 3702 {
3705 writeq_T *last = (writeq_T *)alloc((int)sizeof(writeq_T)); 3703 writeq_T *last = (writeq_T *)alloc((int)sizeof(writeq_T));
3706 3704
3707 if (last != NULL) 3705 if (last != NULL)
3708 { 3706 {
3709 ch_log(channel, "Creating new entry");
3710 last->wq_prev = wq->wq_prev; 3707 last->wq_prev = wq->wq_prev;
3711 last->wq_next = NULL; 3708 last->wq_next = NULL;
3712 if (wq->wq_prev == NULL) 3709 if (wq->wq_prev == NULL)
3713 wq->wq_next = last; 3710 wq->wq_next = last;
3714 else 3711 else