Prototype cleanup; use "config.h" where appropriate

This commit is contained in:
H. Peter Anvin 2007-01-15 01:20:41 -08:00
parent d9938a7d83
commit d15a61abe6
5 changed files with 19 additions and 23 deletions

View file

@ -62,18 +62,6 @@ int writeit(FILE *, struct tftphdr **, int, int);
extern int segsize;
#define MAX_SEGSIZE 65464
/*
* Prototype for xmalloc/xstrdup
*/
extern void *xmalloc(size_t);
extern char *xstrdup(const char *);
/*
* Signal-related stuff
*/
void (*bsd_signal(int, void (*)(int)))(int);
int pick_port_bind(int sockfd, struct sockaddr_in *myaddr, unsigned int from, unsigned int to);
#endif
int pick_port_bind(int sockfd, struct sockaddr_in *myaddr, unsigned int from, unsigned int to);

View file

@ -287,6 +287,21 @@ typedef int socklen_t;
#define EOPTNEG 8
#endif
/* Prototypes for libxtra functions */
void *xmalloc(size_t);
char *xstrdup(const char *);
#ifndef HAVE_BSD_SIGNAL
void (*bsd_signal(int, void (*)(int)))(int);
#endif
#ifndef HAVE_DUP2
int dup2(int, int);
#endif
#ifndef HAVE_DAEMON
int daemon(int, int);
#endif
/* tftp-hpa version and configuration strings */
#include "version.h"

View file

@ -4,11 +4,7 @@
* Use sigaction() to simulate BSD signal()
*/
#include <signal.h>
#include <stdlib.h>
#include <string.h>
void (*bsd_signal(int, void (*)(int)))(int);
#include "config.h"
void (*bsd_signal(int signum, void (*handler)(int)))(int)
{

View file

@ -5,8 +5,7 @@
*
*/
#include <stdlib.h>
#include <stdio.h>
#include "config.h"
void *xmalloc(size_t size)
{

View file

@ -5,9 +5,7 @@
*
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "config.h"
char *xstrdup(const char *s)
{