/* C++ modules. Experimental!
- Copyright (C) 2018-2022 Free Software Foundation, Inc.
+ Copyright (C) 2018-2024 Free Software Foundation, Inc.
Written by Nathan Sidwell <nathan@acm.org> while at FaceBook
This file is part of GCC.
print_version (void)
{
fnotice (stdout, "%s %s%s\n", progname, pkgversion_string, version_string);
- fprintf (stdout, "Copyright %s 2018-2022 Free Software Foundation, Inc.\n",
+ fprintf (stdout, "Copyright %s 2018-2024 Free Software Foundation, Inc.\n",
("(C)"));
fnotice (stdout,
("This is free software; see the source for copying conditions.\n"
hints.ai_next = NULL;
struct addrinfo *addrs = NULL;
- if (int e = getaddrinfo (slash == arg ? NULL : arg, "0", &hints, &addrs))
+ /* getaddrinfo requires either hostname or servname to be non-null, so that we must
+ set a port number (to cover the case that the string passed contains just /NN).
+ Use an arbitrary in-range port number, but avoiding "0" which triggers a bug on
+ some BSD variants. */
+ if (int e = getaddrinfo (slash == arg ? NULL : arg, "1", &hints, &addrs))
{
noisy ("cannot resolve '%s': %s", arg, gai_strerror (e));
ok = false;
}
}
+#if defined (HAVE_PSELECT) || defined (HAVE_SELECT)
if (active < 0 && sock_fd >= 0 && FD_ISSET (sock_fd, &readers))
active = -1;
+#endif
}
if (active >= 0)