chiark / gitweb /
core: rework how we flush incoming traffic when a socket unit goes down
[elogind.git] / src / basic / hostname-util.c
index 6ad479d55fa53fdfbf9c559929abc4f3be8e6b23..3bd3a4d7b3634a4d4175600a6a639a828aed5265 100644 (file)
@@ -1,5 +1,3 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
 /***
   This file is part of systemd.
 
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <ctype.h>
+#if defined(__GLIBC__)
+# include <bits/local_lim.h>
+#endif // defined(__GLIBC__)
+#include <errno.h>
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
 #include <sys/utsname.h>
+#include <unistd.h>
 
 //#include "fd-util.h"
 #include "fileio.h"
 #include "hostname-util.h"
+//#include "macro.h"
 #include "string-util.h"
-#include "util.h"
 
-/// UNNEEDED by elogind
-#if 0
+#if 0 /// UNNEEDED by elogind
 bool hostname_is_set(void) {
         struct utsname u;
 
@@ -75,7 +79,7 @@ static bool hostname_valid_char(char c) {
  * allow_trailing_dot is true and at least two components are present
  * in the name. Note that due to the restricted charset and length
  * this call is substantially more conservative than
- * dns_domain_is_valid().
+ * dns_name_is_valid().
  */
 bool hostname_is_valid(const char *s, bool allow_trailing_dot) {
         unsigned n_dots = 0;
@@ -96,7 +100,7 @@ bool hostname_is_valid(const char *s, bool allow_trailing_dot) {
                                 return false;
 
                         dot = true;
-                        n_dots ++;
+                        n_dots++;
                 } else {
                         if (!hostname_valid_char(*p))
                                 return false;
@@ -116,8 +120,7 @@ bool hostname_is_valid(const char *s, bool allow_trailing_dot) {
         return true;
 }
 
-/// UNNEEDED by elogind
-#if 0
+#if 0 /// UNNEEDED by elogind
 char* hostname_cleanup(char *s) {
         char *p, *d;
         bool dot;
@@ -165,8 +168,7 @@ bool is_localhost(const char *hostname) {
                endswith_no_case(hostname, ".localdomain.");
 }
 
-/// UNNEEDED by elogind
-#if 0
+#if 0 /// UNNEEDED by elogind
 bool is_gateway_hostname(const char *hostname) {
         assert(hostname);