Deleted Added
sdiff udiff text old ( 120161 ) new ( 124208 )
full compact
1/*
2 * Copyright (c) 2000 Markus Friedl. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 9 unchanged lines hidden (view full) ---

18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25#include "includes.h"
26RCSID("$OpenBSD: misc.c,v 1.22 2003/09/18 08:49:45 markus Exp $");
27
28#include "misc.h"
29#include "log.h"
30#include "xmalloc.h"
31
32/* remove newline at end of string */
33char *
34chop(char *s)

--- 20 unchanged lines hidden (view full) ---

55 if (val < 0) {
56 error("fcntl(%d, F_GETFL, 0): %s", fd, strerror(errno));
57 return;
58 }
59 if (val & O_NONBLOCK) {
60 debug2("fd %d is O_NONBLOCK", fd);
61 return;
62 }
63 debug2("fd %d setting O_NONBLOCK", fd);
64 val |= O_NONBLOCK;
65 if (fcntl(fd, F_SETFL, val) == -1)
66 debug("fcntl(%d, F_SETFL, O_NONBLOCK): %s",
67 fd, strerror(errno));
68}
69
70void
71unset_nonblock(int fd)

--- 249 unchanged lines hidden (view full) ---

321 } else if (args->num+2 >= nalloc)
322 nalloc *= 2;
323
324 args->list = xrealloc(args->list, nalloc * sizeof(char *));
325 args->nalloc = nalloc;
326 args->list[args->num++] = xstrdup(buf);
327 args->list[args->num] = NULL;
328}