Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 May 2016 11:17:19 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r299357 - in head/usr.sbin/lpr: common_source lpc
Message-ID:  <201605101117.u4ABHJte091922@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Tue May 10 11:17:19 2016
New Revision: 299357
URL: https://svnweb.freebsd.org/changeset/base/299357

Log:
  Rename getline with get_line to avoid collision with getline(3)
  
  When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added.
  This rename is made in preparation for the removal of this guard

Modified:
  head/usr.sbin/lpr/common_source/common.c
  head/usr.sbin/lpr/common_source/displayq.c
  head/usr.sbin/lpr/common_source/lp.h
  head/usr.sbin/lpr/common_source/rmjob.c
  head/usr.sbin/lpr/lpc/cmds.c

Modified: head/usr.sbin/lpr/common_source/common.c
==============================================================================
--- head/usr.sbin/lpr/common_source/common.c	Tue May 10 11:12:31 2016	(r299356)
+++ head/usr.sbin/lpr/common_source/common.c	Tue May 10 11:17:19 2016	(r299357)
@@ -80,12 +80,12 @@ static int compar(const void *_p1, const
 #define	isdigitch(Anychar) isdigit((u_char)(Anychar))
 
 /*
- * Getline reads a line from the control file cfp, removes tabs, converts
+ * get_line reads a line from the control file cfp, removes tabs, converts
  *  new-line to null and leaves it in line.
  * Returns 0 at EOF or the number of characters read.
  */
 int
-getline(FILE *cfp)
+get_line(FILE *cfp)
 {
 	register int linel = 0;
 	register char *lp = line;

Modified: head/usr.sbin/lpr/common_source/displayq.c
==============================================================================
--- head/usr.sbin/lpr/common_source/displayq.c	Tue May 10 11:12:31 2016	(r299356)
+++ head/usr.sbin/lpr/common_source/displayq.c	Tue May 10 11:17:19 2016	(r299357)
@@ -415,7 +415,7 @@ inform(const struct printer *pp, char *c
 	file[0] = '\0';
 	savedname[0] = '\0';
 	jnum = calc_jobnum(cf, NULL);
-	while (getline(cfp)) {
+	while (get_line(cfp)) {
 		switch (line[0]) {
 		case 'P': /* Was this file specified in the user's list? */
 			if (!inlist(line+1, cf)) {
@@ -445,7 +445,7 @@ inform(const struct printer *pp, char *c
 			}
 			copycnt++;
 			/*
-			 * deliberately 'continue' to another getline(), so
+			 * deliberately 'continue' to another get_line(), so
 			 * all format-spec lines for this datafile are read
 			 * in and counted before calling show()
 			 */

Modified: head/usr.sbin/lpr/common_source/lp.h
==============================================================================
--- head/usr.sbin/lpr/common_source/lp.h	Tue May 10 11:12:31 2016	(r299356)
+++ head/usr.sbin/lpr/common_source/lp.h	Tue May 10 11:17:19 2016	(r299357)
@@ -281,7 +281,7 @@ void	 fatal(const struct printer *_pp, c
 int	 firstprinter(struct printer *_pp, int *_error);
 void	 free_printer(struct printer *_pp);
 void	 free_request(struct request *_rp);
-int	 getline(FILE *_cfp);
+int	 get_line(FILE *_cfp);
 int	 getport(const struct printer *_pp, const char *_rhost, int _rport);
 int	 getprintcap(const char *_printer, struct printer *_pp);
 int	 getq(const struct printer *_pp, struct jobqueue *(*_namelist[]));

Modified: head/usr.sbin/lpr/common_source/rmjob.c
==============================================================================
--- head/usr.sbin/lpr/common_source/rmjob.c	Tue May 10 11:12:31 2016	(r299356)
+++ head/usr.sbin/lpr/common_source/rmjob.c	Tue May 10 11:17:19 2016	(r299357)
@@ -163,7 +163,7 @@ lockchk(struct printer *pp, char *slockf
 			return(0);
 	}
 	PRIV_END
-	if (!getline(fp)) {
+	if (!get_line(fp)) {
 		(void) fclose(fp);
 		return(0);		/* no daemon present */
 	}
@@ -198,7 +198,7 @@ process(const struct printer *pp, char *
 	if ((cfp = fopen(file, "r")) == NULL)
 		fatal(pp, "cannot open %s", file);
 	PRIV_END
-	while (getline(cfp)) {
+	while (get_line(cfp)) {
 		switch (line[0]) {
 		case 'U':  /* unlink associated files */
 			if (strchr(line+1, '/') || strncmp(line+1, "df", 2))
@@ -251,7 +251,7 @@ chk(char *file)
 	if ((cfp = fopen(file, "r")) == NULL)
 		return(0);
 	PRIV_END
-	while (getline(cfp)) {
+	while (get_line(cfp)) {
 		if (line[0] == 'P')
 			break;
 	}

Modified: head/usr.sbin/lpr/lpc/cmds.c
==============================================================================
--- head/usr.sbin/lpr/lpc/cmds.c	Tue May 10 11:12:31 2016	(r299356)
+++ head/usr.sbin/lpr/lpc/cmds.c	Tue May 10 11:17:19 2016	(r299357)
@@ -306,7 +306,7 @@ kill_qtask(const char *lf)
 	}
 
 	/* If the lock file is empty, then there is no daemon to kill */
-	if (getline(fp) == 0)
+	if (get_line(fp) == 0)
 		goto killdone;
 
 	/*
@@ -1292,7 +1292,7 @@ doarg(char *job)
 		PRIV_END
 		if (fp == NULL)
 			continue;
-		while (getline(fp) > 0)
+		while (get_line(fp) > 0)
 			if (line[0] == 'P')
 				break;
 		(void) fclose(fp);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605101117.u4ABHJte091922>