util-linux.vger.kernel.org archive mirror
 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 5/7] write: Use PATH_MAX instead of MAXPATHLEN, as elsewhere.
Date: Fri, 25 May 2012 20:16:16 +0200	[thread overview]
Message-ID: <1337969778-3154-5-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>
---
 term-utils/write.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/term-utils/write.c b/term-utils/write.c
index c8aca7e..901ddc4 100644
--- a/term-utils/write.c
+++ b/term-utils/write.c
@@ -102,7 +102,7 @@ int main(int argc, char **argv)
 	time_t atime;
 	uid_t myuid;
 	int msgsok, myttyfd, c;
-	char tty[MAXPATHLEN], *mytty;
+	char tty[PATH_MAX], *mytty;
 
 	static const struct option longopts[] = {
 		{"version", no_argument, NULL, 'V'},
@@ -296,7 +296,7 @@ void search_utmp(char *user, char *tty, char *mytty, uid_t myuid)
 int term_chk(char *tty, int *msgsokP, time_t * atimeP, int showerror)
 {
 	struct stat s;
-	char path[MAXPATHLEN];
+	char path[PATH_MAX];
 
 	if (strlen(tty) + 6 > sizeof(path))
 		return 1;
@@ -321,7 +321,7 @@ void do_write(char *tty, char *mytty, uid_t myuid)
 	char *login, *pwuid, *nows;
 	struct passwd *pwd;
 	time_t now;
-	char path[MAXPATHLEN], host[MAXHOSTNAMELEN], line[512];
+	char path[PATH_MAX], host[MAXHOSTNAMELEN], line[512];
 
 	/* Determine our login name(s) before the we reopen() stdout */
 	if ((pwd = getpwuid(myuid)) != NULL)
-- 
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   ` [PATCH 3/7] last, login, write: Provide a fallback for MAXHOSTNAMELEN, as elsewhere Thomas Schwinge
2012-05-29  8:10     ` 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   ` Thomas Schwinge [this message]
2012-05-29  8:14     ` [PATCH 5/7] write: Use PATH_MAX instead of MAXPATHLEN, as elsewhere 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-5-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).