summaryrefslogtreecommitdiffstats
path: root/freebsd/lib
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-08-09 13:04:41 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-09-21 10:29:37 +0200
commite4a8065910cd6b2e7e0448cc6431ca2906322389 (patch)
tree73492991cfa40f994c20d761d476e6bc16304536 /freebsd/lib
parentUpdate to FreeBSD head 2017-08-01 (diff)
downloadrtems-libbsd-e4a8065910cd6b2e7e0448cc6431ca2906322389.tar.bz2
Update to FreeBSD head 2017-10-01
Git mirror commit b2f0376b45428f13151d229c5ae9d4d8f74acbd1. Update #3472.
Diffstat (limited to 'freebsd/lib')
-rw-r--r--freebsd/lib/libc/net/getaddrinfo.c9
-rw-r--r--freebsd/lib/libutil/libutil.h1
2 files changed, 5 insertions, 5 deletions
diff --git a/freebsd/lib/libc/net/getaddrinfo.c b/freebsd/lib/libc/net/getaddrinfo.c
index 630bb291..2f97a244 100644
--- a/freebsd/lib/libc/net/getaddrinfo.c
+++ b/freebsd/lib/libc/net/getaddrinfo.c
@@ -37,7 +37,7 @@
* in the source code. This is because RFC2553 is silent about which error
* code must be returned for which situation.
* - freeaddrinfo(NULL). RFC2553 is silent about it. XNET 5.2 says it is
- * invalid. current code - SEGV on freeaddrinfo(NULL)
+ * invalid. Current code accepts NULL to be compatible with other OSes.
*
* Note:
* - The code filters out AFs that are not supported by the kernel,
@@ -361,14 +361,13 @@ freeaddrinfo(struct addrinfo *ai)
{
struct addrinfo *next;
- do {
+ while (ai != NULL) {
next = ai->ai_next;
- if (ai->ai_canonname)
- free(ai->ai_canonname);
+ free(ai->ai_canonname);
/* no need to free(ai->ai_addr) */
free(ai);
ai = next;
- } while (ai);
+ }
}
static int
diff --git a/freebsd/lib/libutil/libutil.h b/freebsd/lib/libutil/libutil.h
index b20ffa29..fa924dbd 100644
--- a/freebsd/lib/libutil/libutil.h
+++ b/freebsd/lib/libutil/libutil.h
@@ -93,6 +93,7 @@ int expand_number(const char *_buf, uint64_t *_num);
int extattr_namespace_to_string(int _attrnamespace, char **_string);
int extattr_string_to_namespace(const char *_string, int *_attrnamespace);
int flopen(const char *_path, int _flags, ...);
+int flopenat(int _dirfd, const char *_path, int _flags, ...);
int forkpty(int *_amaster, char *_name,
struct termios *_termp, struct winsize *_winp);
void hexdump(const void *_ptr, int _length, const char *_hdr, int _flags);