Author: axeld Date: 2010-10-04 16:00:44 +0200 (Mon, 04 Oct 2010) New Revision: 38881 Changeset: http://dev.haiku-os.org/changeset/38881 Modified: haiku/trunk/src/bin/network/ftpd/extern.h haiku/trunk/src/bin/network/ftpd/ftpcmd.y haiku/trunk/src/bin/network/ftpd/ftpd.c Log: * ftpd had a function getline() with non standards compatible parameters. * This fixes the build. Modified: haiku/trunk/src/bin/network/ftpd/extern.h =================================================================== --- haiku/trunk/src/bin/network/ftpd/extern.h 2010-10-04 12:37:48 UTC (rev 38880) +++ haiku/trunk/src/bin/network/ftpd/extern.h 2010-10-04 14:00:44 UTC (rev 38881) @@ -46,7 +46,7 @@ void ftpd_logwtmp(char *, char *, struct sockaddr *addr); int ftpd_pclose(FILE *); FILE *ftpd_popen(char *, char *); -char *getline(char *, int, FILE *); +char *ftpd_getline(char *, int, FILE *); void lreply(int, const char *, ...) __printflike(2, 3); void makedir(char *); void nack(char *); Modified: haiku/trunk/src/bin/network/ftpd/ftpcmd.y =================================================================== --- haiku/trunk/src/bin/network/ftpd/ftpcmd.y 2010-10-04 12:37:48 UTC (rev 38880) +++ haiku/trunk/src/bin/network/ftpd/ftpcmd.y 2010-10-04 14:00:44 UTC (rev 38881) @@ -542,7 +542,7 @@ case MODE_S: reply(200, "MODE S accepted."); break; - + default: reply(502, "Unimplemented MODE type."); } @@ -1194,10 +1194,10 @@ #include <arpa/telnet.h> /* - * getline - a hacked up version of fgets to ignore TELNET escape codes. + * ftpd_getline - a hacked up version of fgets to ignore TELNET escape codes. */ char * -getline(char *s, int n, FILE *iop) +ftpd_getline(char *s, int n, FILE *iop) { int c; register char *cs; @@ -1305,7 +1305,7 @@ case CMD: (void) signal(SIGALRM, toolong); (void) alarm(timeout); - if (getline(cbuf, sizeof(cbuf)-1, stdin) == NULL) { + if (ftpd_getline(cbuf, sizeof(cbuf)-1, stdin) == NULL) { reply(221, "You could at least say goodbye."); dologout(0); } Modified: haiku/trunk/src/bin/network/ftpd/ftpd.c =================================================================== --- haiku/trunk/src/bin/network/ftpd/ftpd.c 2010-10-04 12:37:48 UTC (rev 38880) +++ haiku/trunk/src/bin/network/ftpd/ftpd.c 2010-10-04 14:00:44 UTC (rev 38881) @@ -1062,7 +1062,7 @@ reply(530, "Sorry, only anonymous ftp allowed."); return; } - + if ((pw = sgetpwnam(name))) { if ((shell = pw->pw_shell) == NULL || *shell == 0) shell = _PATH_BSHELL; @@ -2838,7 +2838,7 @@ return (0); } cp = tmpline; - if (getline(cp, 7, stdin) == NULL) { + if (ftpd_getline(cp, 7, stdin) == NULL) { reply(221, "You could at least say goodbye."); dologout(0); } @@ -2930,7 +2930,7 @@ #endif else goto pasv_error; - + p = (char *) &pasv_addr.su_port; #define UC(b) (((int) b) & 0xff) @@ -2989,7 +2989,7 @@ return; } } - + pdata = socket(ctrl_addr.su_family, SOCK_STREAM, 0); if (pdata < 0) { perror_reply(425, "Can't open passive connection"); @@ -3128,7 +3128,7 @@ /* -4 is for the .nn<null> we put on the end below */ (void) snprintf(new, sizeof(new) - 4, "%s", local); cp = new + strlen(new); - /* + /* * Don't generate dotfile unless requested explicitly. * This covers the case when basename gets truncated off * by buffer size.