Module Name: src
Committed By: christos
Date: Sat Jun 22 23:40:53 UTC 2019
Modified Files:
src/usr.bin/ftp: extern.h util.c
Log Message:
trim down error checking if we are small.
To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/usr.bin/ftp/extern.h
cvs rdiff -u -r1.159 -r1.160 src/usr.bin/ftp/util.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/ftp/extern.h
diff -u src/usr.bin/ftp/extern.h:1.81 src/usr.bin/ftp/extern.h:1.82
--- src/usr.bin/ftp/extern.h:1.81 Sun Feb 3 23:09:13 2019
+++ src/usr.bin/ftp/extern.h Sat Jun 22 19:40:53 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.81 2019/02/04 04:09:13 mrg Exp $ */
+/* $NetBSD: extern.h,v 1.82 2019/06/22 23:40:53 christos Exp $ */
/*-
* Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
@@ -243,7 +243,14 @@ void user(int, char **);
int ftp_connect(int, const struct sockaddr *, socklen_t, int);
int ftp_listen(int, int);
int ftp_poll(struct pollfd *, int, int);
+#ifndef SMALL
void *ftp_malloc(size_t);
StringList *ftp_sl_init(void);
void ftp_sl_add(StringList *, char *);
char *ftp_strdup(const char *);
+#else
+#define ftp_malloc(a) malloc(a);
+#define ftp_sl_init() sl_init()
+#define ftp_sl_add(a, b) sl_add((a), (b))
+#define ftp_strdup(a) strdup(a)
+#endif
Index: src/usr.bin/ftp/util.c
diff -u src/usr.bin/ftp/util.c:1.159 src/usr.bin/ftp/util.c:1.160
--- src/usr.bin/ftp/util.c:1.159 Mon Nov 20 16:11:36 2017
+++ src/usr.bin/ftp/util.c Sat Jun 22 19:40:53 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: util.c,v 1.159 2017/11/20 21:11:36 kre Exp $ */
+/* $NetBSD: util.c,v 1.160 2019/06/22 23:40:53 christos Exp $ */
/*-
* Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: util.c,v 1.159 2017/11/20 21:11:36 kre Exp $");
+__RCSID("$NetBSD: util.c,v 1.160 2019/06/22 23:40:53 christos Exp $");
#endif /* not lint */
/*
@@ -1491,6 +1491,7 @@ ftp_poll(struct pollfd *fds, int nfds, i
return poll(fds, nfds, timeout);
}
+#ifndef SMALL
/*
* malloc() with inbuilt error checking
*/
@@ -1545,3 +1546,4 @@ ftp_strdup(const char *str)
err(1, "Unable to allocate memory for string copy");
return (s);
}
+#endif