trim down error checking if we are small.

This commit is contained in:
christos 2019-06-22 23:40:53 +00:00
parent 9bedb72e28
commit 4a69030bcd
2 changed files with 12 additions and 3 deletions

View File

@ -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

View File

@ -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, int timeout)
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