From c80a45c967a30b0e865e5e6c8f674b2d5566c50b Mon Sep 17 00:00:00 2001 From: bapt Date: Tue, 10 May 2016 11:17:19 +0000 Subject: [PATCH] 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 --- usr.sbin/lpr/common_source/common.c | 4 ++-- usr.sbin/lpr/common_source/displayq.c | 4 ++-- usr.sbin/lpr/common_source/lp.h | 2 +- usr.sbin/lpr/common_source/rmjob.c | 6 +++--- usr.sbin/lpr/lpc/cmds.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/usr.sbin/lpr/common_source/common.c b/usr.sbin/lpr/common_source/common.c index 0f960e8d090b..7311940ca76a 100644 --- a/usr.sbin/lpr/common_source/common.c +++ b/usr.sbin/lpr/common_source/common.c @@ -80,12 +80,12 @@ static int compar(const void *_p1, const void *_p2); #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; diff --git a/usr.sbin/lpr/common_source/displayq.c b/usr.sbin/lpr/common_source/displayq.c index 3c038d66430e..d987cfa4a15a 100644 --- a/usr.sbin/lpr/common_source/displayq.c +++ b/usr.sbin/lpr/common_source/displayq.c @@ -415,7 +415,7 @@ inform(const struct printer *pp, char *cf) 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 *cf) } 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() */ diff --git a/usr.sbin/lpr/common_source/lp.h b/usr.sbin/lpr/common_source/lp.h index fb05d2f92ad9..a6ae6073247e 100644 --- a/usr.sbin/lpr/common_source/lp.h +++ b/usr.sbin/lpr/common_source/lp.h @@ -281,7 +281,7 @@ void fatal(const struct printer *_pp, const char *_msg, ...) 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[])); diff --git a/usr.sbin/lpr/common_source/rmjob.c b/usr.sbin/lpr/common_source/rmjob.c index 96f20bef8eae..700e3c2a1d57 100644 --- a/usr.sbin/lpr/common_source/rmjob.c +++ b/usr.sbin/lpr/common_source/rmjob.c @@ -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 *file) 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; } diff --git a/usr.sbin/lpr/lpc/cmds.c b/usr.sbin/lpr/lpc/cmds.c index f960f7c315a6..d85e8eab58b6 100644 --- a/usr.sbin/lpr/lpc/cmds.c +++ b/usr.sbin/lpr/lpc/cmds.c @@ -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);