From owner-svn-src-all@freebsd.org Tue May 10 11:12:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFB77B3526C; Tue, 10 May 2016 11:12:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DF2B1EBE; Tue, 10 May 2016 11:12:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ABCW4V091542; Tue, 10 May 2016 11:12:32 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ABCWoe091535; Tue, 10 May 2016 11:12:32 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605101112.u4ABCWoe091535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 May 2016 11:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299356 - in head: libexec/ftpd usr.bin/gencat usr.bin/uudecode usr.sbin/inetd usr.sbin/lpr/lpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2016 11:12:33 -0000 Author: bapt Date: Tue May 10 11:12:31 2016 New Revision: 299356 URL: https://svnweb.freebsd.org/changeset/base/299356 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/libexec/ftpd/extern.h head/libexec/ftpd/ftpcmd.y head/libexec/ftpd/ftpd.c head/usr.bin/gencat/gencat.c head/usr.bin/uudecode/uudecode.c head/usr.sbin/inetd/builtins.c head/usr.sbin/lpr/lpd/printjob.c Modified: head/libexec/ftpd/extern.h ============================================================================== --- head/libexec/ftpd/extern.h Tue May 10 11:11:23 2016 (r299355) +++ head/libexec/ftpd/extern.h Tue May 10 11:12:31 2016 (r299356) @@ -42,7 +42,7 @@ void fatalerror(char *); void ftpd_logwtmp(char *, char *, struct sockaddr *addr); int ftpd_pclose(FILE *); FILE *ftpd_popen(char *, char *); -int getline(char *, int, FILE *); +int get_line(char *, int, FILE *); void lreply(int, const char *, ...) __printflike(2, 3); void makedir(char *); void nack(char *); Modified: head/libexec/ftpd/ftpcmd.y ============================================================================== --- head/libexec/ftpd/ftpcmd.y Tue May 10 11:11:23 2016 (r299355) +++ head/libexec/ftpd/ftpcmd.y Tue May 10 11:12:31 2016 (r299356) @@ -1158,10 +1158,10 @@ lookup(struct tab *p, char *cmd) #include /* - * getline - a hacked up version of fgets to ignore TELNET escape codes. + * get_line - a hacked up version of fgets to ignore TELNET escape codes. */ int -getline(char *s, int n, FILE *iop) +get_line(char *s, int n, FILE *iop) { int c; register char *cs; @@ -1280,7 +1280,7 @@ yylex(void) case CMD: (void) signal(SIGALRM, toolong); (void) alarm(timeout); - n = getline(cbuf, sizeof(cbuf)-1, stdin); + n = get_line(cbuf, sizeof(cbuf)-1, stdin); if (n == -1) { reply(221, "You could at least say goodbye."); dologout(0); Modified: head/libexec/ftpd/ftpd.c ============================================================================== --- head/libexec/ftpd/ftpd.c Tue May 10 11:11:23 2016 (r299355) +++ head/libexec/ftpd/ftpd.c Tue May 10 11:12:31 2016 (r299356) @@ -2820,7 +2820,7 @@ myoob(void) return (0); } cp = tmpline; - ret = getline(cp, 7, stdin); + ret = get_line(cp, 7, stdin); if (ret == -1) { reply(221, "You could at least say goodbye."); dologout(0); Modified: head/usr.bin/gencat/gencat.c ============================================================================== --- head/usr.bin/gencat/gencat.c Tue May 10 11:11:23 2016 (r299355) +++ head/usr.bin/gencat/gencat.c Tue May 10 11:12:31 2016 (r299356) @@ -104,7 +104,7 @@ static long lineno = 0; static char *cskip(char *); static void error(const char *); -static char *getline(int); +static char *get_line(int); static char *getmsg(int, char *, char); static void warning(const char *, const char *); static char *wskip(char *); @@ -231,7 +231,7 @@ xstrdup(const char *str) } static char * -getline(int fd) +get_line(int fd) { static long curlen = BUFSIZ; static char buf[BUFSIZ], *bptr = buf, *bend = buf; @@ -334,7 +334,7 @@ getmsg(int fd, char *cptr, char quote) ++cptr; switch (*cptr) { case '\0': - cptr = getline(fd); + cptr = get_line(fd); if (!cptr) error("premature end of file"); msglen += strlen(cptr); @@ -394,7 +394,7 @@ MCParse(int fd) /* XXX: init sethead? */ - while ((cptr = getline(fd))) { + while ((cptr = get_line(fd))) { if (*cptr == '$') { ++cptr; if (strncmp(cptr, "set", 3) == 0) { Modified: head/usr.bin/uudecode/uudecode.c ============================================================================== --- head/usr.bin/uudecode/uudecode.c Tue May 10 11:11:23 2016 (r299355) +++ head/usr.bin/uudecode/uudecode.c Tue May 10 11:12:31 2016 (r299356) @@ -300,7 +300,7 @@ decode2(void) } static int -getline(char *buf, size_t size) +get_line(char *buf, size_t size) { if (fgets(buf, size, infp) != NULL) @@ -338,7 +338,7 @@ uu_decode(void) /* for each input line */ for (;;) { - switch (getline(buf, sizeof(buf))) { + switch (get_line(buf, sizeof(buf))) { case 0: return (0); case 1: @@ -397,7 +397,7 @@ uu_decode(void) } } } - switch (getline(buf, sizeof(buf))) { + switch (get_line(buf, sizeof(buf))) { case 0: return (0); case 1: @@ -418,7 +418,7 @@ base64_decode(void) leftover[0] = '\0'; for (;;) { strcpy(inbuf, leftover); - switch (getline(inbuf + strlen(inbuf), + switch (get_line(inbuf + strlen(inbuf), sizeof(inbuf) - strlen(inbuf))) { case 0: return (0); Modified: head/usr.sbin/inetd/builtins.c ============================================================================== --- head/usr.sbin/inetd/builtins.c Tue May 10 11:11:23 2016 (r299355) +++ head/usr.sbin/inetd/builtins.c Tue May 10 11:12:31 2016 (r299356) @@ -60,7 +60,7 @@ void discard_dg(int, struct servtab *); void discard_stream(int, struct servtab *); void echo_dg(int, struct servtab *); void echo_stream(int, struct servtab *); -static int getline(int, char *, int); +static int get_line(int, char *, int); void iderror(int, int, int, const char *); void ident_stream(int, struct servtab *); void initring(void); @@ -740,7 +740,7 @@ machtime_stream(int s, struct servtab *s #define strwrite(fd, buf) (void) write(fd, buf, sizeof(buf)-1) static int /* # of characters up to \r,\n or \0 */ -getline(int fd, char *buf, int len) +get_line(int fd, char *buf, int len) { int count = 0, n; struct sigaction sa; @@ -775,7 +775,7 @@ tcpmux(int s) int len; /* Get requested service name */ - if ((len = getline(s, service, MAX_SERV_LEN)) < 0) { + if ((len = get_line(s, service, MAX_SERV_LEN)) < 0) { strwrite(s, "-Error reading service name\r\n"); return (NULL); } Modified: head/usr.sbin/lpr/lpd/printjob.c ============================================================================== --- head/usr.sbin/lpr/lpd/printjob.c Tue May 10 11:11:23 2016 (r299355) +++ head/usr.sbin/lpr/lpd/printjob.c Tue May 10 11:12:31 2016 (r299356) @@ -447,12 +447,12 @@ printit(struct printer *pp, char *file) * M -- "mail" to user when done printing * Z -- "locale" for pr * - * getline reads a line and expands tabs to blanks + * get_line reads a line and expands tabs to blanks */ /* pass 1 */ - while (getline(cfp)) + while (get_line(cfp)) switch (line[0]) { case 'H': strlcpy(origin_host, line + 1, sizeof(origin_host)); @@ -577,7 +577,7 @@ printit(struct printer *pp, char *file) pass2: fseek(cfp, 0L, 0); - while (getline(cfp)) + while (get_line(cfp)) switch (line[0]) { case 'L': /* identification line */ if (!pp->no_header && pp->header_last) @@ -922,7 +922,7 @@ sendit(struct printer *pp, char *file) * pass 1 */ err = OK; - while (getline(cfp)) { + while (get_line(cfp)) { again: if (line[0] == 'S') { cp = line+1; @@ -954,7 +954,7 @@ sendit(struct printer *pp, char *file) } else if (line[0] >= 'a' && line[0] <= 'z') { dfcopies = 1; strcpy(last, line); - while ((i = getline(cfp)) != 0) { + while ((i = get_line(cfp)) != 0) { if (strcmp(last, line) != 0) break; dfcopies++; @@ -983,7 +983,7 @@ sendit(struct printer *pp, char *file) * pass 2 */ fseek(cfp, 0L, 0); - while (getline(cfp)) + while (get_line(cfp)) if (line[0] == 'U' && !strchr(line+1, '/')) (void) unlink(line+1); /*