From 1b11c13ec312f9f017cd364afb866f81fcec2462 Mon Sep 17 00:00:00 2001 From: Martynas Venckus Date: Mon, 27 Apr 2009 22:51:52 +0000 Subject: remove uploading and macros support from install media; to save some space discussed with theo, todd@, millert@ tested and looked over by sthen@ --- usr.bin/ftp/cmds.c | 14 ++++++++++++-- usr.bin/ftp/cmdtab.c | 14 +++++++++++++- usr.bin/ftp/domacro.c | 6 +++++- usr.bin/ftp/extern.h | 16 +++++++++++++++- usr.bin/ftp/ftp.c | 4 +++- usr.bin/ftp/ftp_var.h | 4 +++- usr.bin/ftp/main.c | 4 +++- usr.bin/ftp/util.c | 4 +++- 8 files changed, 57 insertions(+), 9 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/ftp/cmds.c b/usr.bin/ftp/cmds.c index 7d5ebe2e75b..d050003c2dc 100644 --- a/usr.bin/ftp/cmds.c +++ b/usr.bin/ftp/cmds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmds.c,v 1.68 2009/04/27 21:37:13 deraadt Exp $ */ +/* $OpenBSD: cmds.c,v 1.69 2009/04/27 22:51:51 martynas Exp $ */ /* $NetBSD: cmds.c,v 1.27 1997/08/18 10:20:15 lukem Exp $ */ /* @@ -270,16 +270,19 @@ reput(int argc, char *argv[]) } #endif /* !SMALL */ +#ifndef SMALL void put(int argc, char *argv[]) { (void)putit(argc, argv, 0); } +#endif /* !SMALL */ /* * Send a single file. */ +#ifndef SMALL void putit(int argc, char *argv[], int restartit) { @@ -342,10 +345,12 @@ usage: if (oldargv1 != argv[1]) /* free up after globulize() */ free(argv[1]); } +#endif /* !SMALL */ /* * Send multiple files. */ +#ifndef SMALL void mput(int argc, char *argv[]) { @@ -514,6 +519,7 @@ usage: (void)signal(SIGINT, oldintr); mflag = 0; } +#endif /* !SMALL */ #ifndef SMALL void @@ -857,13 +863,13 @@ status(int argc, char *argv[]) epsv4bad ? " (disabled for this connection)" : ""); #ifndef SMALL fprintf(ttyout, "Command line editing: %s.\n", onoff(editing)); -#endif /* !SMALL */ if (macnum > 0) { fputs("Macros:\n", ttyout); for (i=0; i #include #include @@ -142,3 +144,5 @@ TOP: goto TOP; } } + +#endif /* !SMALL */ diff --git a/usr.bin/ftp/extern.h b/usr.bin/ftp/extern.h index 7891c696512..fd6ec8b7bcc 100644 --- a/usr.bin/ftp/extern.h +++ b/usr.bin/ftp/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.37 2009/04/26 21:26:03 martynas Exp $ */ +/* $OpenBSD: extern.h,v 1.38 2009/04/27 22:51:51 martynas Exp $ */ /* $NetBSD: extern.h,v 1.17 1997/08/18 10:20:19 lukem Exp $ */ /* @@ -66,7 +66,9 @@ void abort_remote(FILE *); void abortpt(int); void abortrecv(int); +#ifndef SMALL void abortsend(int); +#endif /* !SMALL */ void account(int, char **); void alarmtimer(int); int another(int *, char ***, const char *); @@ -88,7 +90,9 @@ void deletecmd(int, char **); void disconnect(int, char **); void do_chmod(int, char **); void do_umask(int, char **); +#ifndef SMALL void domacro(int, char **); +#endif /* !SMALL */ char *domap(char *); void doproxy(int, char **); char *dotrans(char *); @@ -113,14 +117,18 @@ void lostpeer(void); void lpwd(int, char **); void ls(int, char **); void mabort(int); +#ifndef SMALL void macdef(int, char **); +#endif /* !SMALL */ void makeargv(void); void makedir(int, char **); void mdelete(int, char **); void mget(int, char **); void mls(int, char **); void modtime(int, char **); +#ifndef SMALL void mput(int, char **); +#endif /* !SMALL */ char *onoff(int); void newer(int, char **); void page(int, char **); @@ -132,8 +140,10 @@ void psabort(int); void psummary(int); void pswitch(int); void ptransfer(int); +#ifndef SMALL void put(int, char **); void putit(int, char **, int); +#endif /* !SMALL */ void pwd(int, char **); void quit(int, char **); void quote(int, char **); @@ -149,12 +159,16 @@ off_t remotesize(const char *, int); time_t remotemodtime(const char *, int); void removedir(int, char **); void renamefile(int, char **); +#ifndef SMALL void reput(int, char **); +#endif /* !SMALL */ void reset(int, char **); void restart(int, char **); void rmthelp(int, char **); void rmtstatus(int, char **); +#ifndef SMALL void sendrequest(const char *, const char *, const char *, int); +#endif /* !SMALL */ void setascii(int, char **); void setbell(int, char **); void setbinary(int, char **); diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c index c1509e63b60..4842050c920 100644 --- a/usr.bin/ftp/ftp.c +++ b/usr.bin/ftp/ftp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ftp.c,v 1.76 2009/04/27 21:37:13 deraadt Exp $ */ +/* $OpenBSD: ftp.c,v 1.77 2009/04/27 22:51:51 martynas Exp $ */ /* $NetBSD: ftp.c,v 1.27 1997/08/18 10:20:23 lukem Exp $ */ /* @@ -524,6 +524,7 @@ getreply(int expecteof) } } +#ifndef SMALL jmp_buf sendabort; /* ARGSUSED */ @@ -822,6 +823,7 @@ abort: if (bytes > 0) ptransfer(0); } +#endif /* !SMALL */ jmp_buf recvabort; diff --git a/usr.bin/ftp/ftp_var.h b/usr.bin/ftp/ftp_var.h index 05990783b3e..ac5ec68981b 100644 --- a/usr.bin/ftp/ftp_var.h +++ b/usr.bin/ftp/ftp_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ftp_var.h,v 1.27 2008/07/08 21:07:57 martynas Exp $ */ +/* $OpenBSD: ftp_var.h,v 1.28 2009/04/27 22:51:51 martynas Exp $ */ /* $NetBSD: ftp_var.h,v 1.18 1997/08/18 10:20:25 lukem Exp $ */ /* @@ -216,8 +216,10 @@ struct macel { char *mac_end; /* end of macro in macbuf */ }; +#ifndef SMALL int macnum; /* number of defined macros */ struct macel macros[16]; char macbuf[4096]; +#endif /* !SMALL */ FILE *ttyout; /* stdout or stderr, depending on interactive */ diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c index d16eadb8b45..32b78c18863 100644 --- a/usr.bin/ftp/main.c +++ b/usr.bin/ftp/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.75 2009/04/27 21:37:13 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.76 2009/04/27 22:51:51 martynas Exp $ */ /* $NetBSD: main.c,v 1.24 1997/08/18 10:20:26 lukem Exp $ */ /* @@ -334,7 +334,9 @@ main(volatile int argc, char *argv[]) if (!retry_connect) break; if (!connected) { +#ifndef SMALL macnum = 0; +#endif /* !SMALL */ fputs("Retrying...\n", ttyout); sleep(retry_connect); } diff --git a/usr.bin/ftp/util.c b/usr.bin/ftp/util.c index fb5e1a735bc..bc32c337552 100644 --- a/usr.bin/ftp/util.c +++ b/usr.bin/ftp/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.60 2009/04/27 21:37:13 deraadt Exp $ */ +/* $OpenBSD: util.c,v 1.61 2009/04/27 22:51:51 martynas Exp $ */ /* $NetBSD: util.c,v 1.12 1997/08/18 10:20:27 lukem Exp $ */ /*- @@ -316,6 +316,7 @@ tryagain: if (proxy) return (1); connected = -1; +#ifndef SMALL for (n = 0; n < macnum; ++n) { if (!strcmp("init", macros[n].mac_name)) { (void)strlcpy(line, "$init", sizeof line); @@ -324,6 +325,7 @@ tryagain: break; } } +#endif /* SMALL */ return (1); } -- cgit v1.2.3