All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: util-linux@vger.kernel.org
Cc: Thomas Schwinge <thomas@codesourcery.com>
Subject: [PATCH 3/7] last, login, write: Provide a fallback for MAXHOSTNAMELEN, as elsewhere.
Date: Fri, 25 May 2012 20:16:14 +0200	[thread overview]
Message-ID: <1337969778-3154-3-git-send-email-thomas@codesourcery.com> (raw)
In-Reply-To: <1337969778-3154-1-git-send-email-thomas@codesourcery.com>

Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
---
 login-utils/last.c  |    8 ++++++++
 login-utils/login.c |    8 ++++++++
 term-utils/write.c  |    8 ++++++++
 3 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/login-utils/last.c b/login-utils/last.c
index 1b1bee1..4d09c4b 100644
--- a/login-utils/last.c
+++ b/login-utils/last.c
@@ -62,6 +62,14 @@
 #include "xalloc.h"
 #include "c.h"
 
+#ifndef MAXHOSTNAMELEN
+# ifdef HOST_NAME_MAX
+#  define MAXHOSTNAMELEN HOST_NAME_MAX
+# else
+#  define MAXHOSTNAMELEN 64
+# endif
+#endif
+
 #define	SECDAY	(24*60*60)			/* seconds in a day */
 #define	NO	0				/* false/no */
 #define	YES	1				/* true/yes */
diff --git a/login-utils/login.c b/login-utils/login.c
index 7b4f8b5..f459b79 100644
--- a/login-utils/login.c
+++ b/login-utils/login.c
@@ -71,6 +71,14 @@
 
 #include "logindefs.h"
 
+#ifndef MAXHOSTNAMELEN
+# ifdef HOST_NAME_MAX
+#  define MAXHOSTNAMELEN HOST_NAME_MAX
+# else
+#  define MAXHOSTNAMELEN 64
+# endif
+#endif
+
 #define is_pam_failure(_rc)	((_rc) != PAM_SUCCESS)
 
 #define LOGIN_MAX_TRIES        3
diff --git a/term-utils/write.c b/term-utils/write.c
index 2a94792..c8aca7e 100644
--- a/term-utils/write.c
+++ b/term-utils/write.c
@@ -65,6 +65,14 @@
 #include "closestream.h"
 #include "nls.h"
 
+#ifndef MAXHOSTNAMELEN
+# ifdef HOST_NAME_MAX
+#  define MAXHOSTNAMELEN HOST_NAME_MAX
+# else
+#  define MAXHOSTNAMELEN 64
+# endif
+#endif
+
 static void __attribute__ ((__noreturn__)) usage(FILE * out);
 void search_utmp(char *, char *, char *, uid_t);
 void do_write(char *, char *, uid_t);
-- 
1.7.9


  parent reply	other threads:[~2012-05-25 18:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-25 18:13 Portability patches for GNU/Hurd Thomas Schwinge
2012-05-25 18:13 ` [PATCH] test_pager: Repair build for non-Linux Thomas Schwinge
2012-05-29  8:00   ` Karel Zak
2012-05-25 18:16 ` [PATCH 1/7] kill, raw, rename: Don't explicitly enable for --enable-most-builds Thomas Schwinge
2012-05-25 18:16   ` [PATCH 2/7] arch, eject, elvtune: Gracefully disable on non-Linux platforms Thomas Schwinge
2012-05-29  8:01     ` Karel Zak
2012-05-25 18:16   ` Thomas Schwinge [this message]
2012-05-29  8:10     ` [PATCH 3/7] last, login, write: Provide a fallback for MAXHOSTNAMELEN, as elsewhere Karel Zak
2012-05-29  8:40       ` Thomas Schwinge
2012-05-25 18:16   ` [PATCH 4/7] login: Include <linux/major.h> only if it exists Thomas Schwinge
2012-05-25 18:16   ` [PATCH 5/7] write: Use PATH_MAX instead of MAXPATHLEN, as elsewhere Thomas Schwinge
2012-05-29  8:14     ` Karel Zak
2012-05-25 18:16   ` [PATCH 6/7] write: Don't explicitly include <asm/param.h> Thomas Schwinge
2012-05-29  8:14     ` Karel Zak
2012-05-25 18:16   ` [PATCH 7/7] setsid: Include <sys/ioctl.h> instead of <termio.h> Thomas Schwinge
2012-05-29  8:14     ` Karel Zak
2012-05-29  8:01   ` [PATCH 1/7] kill, raw, rename: Don't explicitly enable for --enable-most-builds Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1337969778-3154-3-git-send-email-thomas@codesourcery.com \
    --to=thomas@codesourcery.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.