Deleted Added
full compact
0a1
> /* $FreeBSD: head/contrib/libreadline/shell.c 58314 2000-03-19 22:00:57Z ache $ */
11c12
< as published by the Free Software Foundation; either version 1, or
---
> as published by the Free Software Foundation; either version 2, or
22c23
< 675 Mass Ave, Cambridge, MA 02139, USA. */
---
> 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
46a48
> #include <fcntl.h>
48a51,55
> #include <stdio.h>
>
> #include "rlshell.h"
> #include "xmalloc.h"
>
53c60,62
< extern char *xmalloc ();
---
> #ifndef NULL
> # define NULL 0
> #endif
66c75
< result = (char *)xmalloc (3 + (3 * strlen (string)));
---
> result = (char *)xmalloc (3 + (4 * strlen (string)));
133a143,176
>
> #if !defined (O_NDELAY)
> # if defined (FNDELAY)
> # define O_NDELAY FNDELAY
> # endif
> #endif
>
> int
> unset_nodelay_mode (fd)
> int fd;
> {
> int flags, bflags;
>
> if ((flags = fcntl (fd, F_GETFL, 0)) < 0)
> return -1;
>
> bflags = 0;
>
> #ifdef O_NONBLOCK
> bflags |= O_NONBLOCK;
> #endif
>
> #ifdef O_NDELAY
> bflags |= O_NDELAY;
> #endif
>
> if (flags & bflags)
> {
> flags &= ~bflags;
> return (fcntl (fd, F_SETFL, flags));
> }
>
> return 0;
> }