Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/ftp trim down error checking if we are small.



details:   https://anonhg.NetBSD.org/src/rev/52fc061dbe63
branches:  trunk
changeset: 999899:52fc061dbe63
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jun 22 23:40:53 2019 +0000

description:
trim down error checking if we are small.

diffstat:

 usr.bin/ftp/extern.h |  9 ++++++++-
 usr.bin/ftp/util.c   |  6 ++++--
 2 files changed, 12 insertions(+), 3 deletions(-)

diffs (55 lines):

diff -r 638282019a98 -r 52fc061dbe63 usr.bin/ftp/extern.h
--- a/usr.bin/ftp/extern.h      Sat Jun 22 23:40:33 2019 +0000
+++ b/usr.bin/ftp/extern.h      Sat Jun 22 23:40:53 2019 +0000
@@ -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 @@
 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
diff -r 638282019a98 -r 52fc061dbe63 usr.bin/ftp/util.c
--- a/usr.bin/ftp/util.c        Sat Jun 22 23:40:33 2019 +0000
+++ b/usr.bin/ftp/util.c        Sat Jun 22 23:40:53 2019 +0000
@@ -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 @@
        return poll(fds, nfds, timeout);
 }
 
+#ifndef SMALL
 /*
  * malloc() with inbuilt error checking
  */
@@ -1545,3 +1546,4 @@
                err(1, "Unable to allocate memory for string copy");
        return (s);
 }
+#endif



Home | Main Index | Thread Index | Old Index