]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
include/c: move fallback for MAXHOSTNAMELEN to c.h
authorKarel Zak <kzak@redhat.com>
Tue, 29 May 2012 08:08:25 +0000 (10:08 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 29 May 2012 08:08:25 +0000 (10:08 +0200)
Reported-by: Thomas Schwinge <thomas@codesourcery.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
include/c.h
term-utils/agetty.c
term-utils/wall.c

index 8c8db73324b590152b70c2e1cdd08fd67be7710e..40d289bf7b65af8f84f348f4a055330c3e5b882a 100644 (file)
@@ -222,6 +222,17 @@ static inline int dirfd(DIR *d)
 #define IUTF8 0040000
 #endif
 
+/*
+ * Fallback for MAXHOSTNAMELEN
+ */
+#ifndef MAXHOSTNAMELEN
+# ifdef HOST_NAME_MAX
+#  define MAXHOSTNAMELEN HOST_NAME_MAX
+# else
+#  define MAXHOSTNAMELEN 64
+# endif
+#endif
+
 /*
  * Constant strings for usage() functions. For more info see
  * Documentation/howto-usage-function.txt and sys-utils/arch.c
index 36e00eb44fbae8d47f99cec3068ede7457c6f31a..9101e7fd3846054fed1cb4aef39bb030244cdd4f 100644 (file)
 #define DEF_EOL                0
 #define DEF_SWITCH     0               /* default switch char */
 
-#ifndef MAXHOSTNAMELEN
-#  ifdef HOST_NAME_MAX
-#    define MAXHOSTNAMELEN HOST_NAME_MAX
-#  else
-#    define MAXHOSTNAMELEN 64
-#  endif                       /* HOST_NAME_MAX */
-#endif                         /* MAXHOSTNAMELEN */
-
 /*
  * When multiple baud rates are specified on the command line, the first one
  * we will try is the first one specified.
index ec9e93236d63f0e49fcde19c7d006bb0cc3d6786..0291a5b609b1004a5d228513407ce8cf4f5a0665 100644 (file)
 #define        IGNOREUSER      "sleeper"
 #define WRITE_TIME_OUT 300             /* in seconds */
 
-#ifndef MAXHOSTNAMELEN
-# ifdef HOST_NAME_MAX
-#  define MAXHOSTNAMELEN HOST_NAME_MAX
-# else
-#  define MAXHOSTNAMELEN 64
-# endif
-#endif
-
 /* Function prototypes */
 char *makemsg(char *fname, size_t *mbufsize, int print_banner);
 static void usage(FILE *out);