#include "bacula.h"
#include "jcr.h"
+#include <netdb.h>
extern time_t watchdog_time;
#define NO_DATA 4 /* Valid name, no data record of requested type. */
#endif
-#ifndef HAVE_WIN32
-extern int h_errno; /* On error has one of the above */
-#endif
/*
* Get human readable error for gethostbyname()
*/
-static char *gethost_strerror()
+static const char *gethost_strerror()
{
switch (h_errno) {
case NETDB_INTERNAL:
* ***FIXME*** implement service from /etc/services
*/
static BSOCK *
-bnet_open(JCR *jcr, char *name, char *host, char *service, int port, int *fatal)
+bnet_open(JCR *jcr, const char *name, char *host, char *service, int port, int *fatal)
{
int sockfd;
struct sockaddr_in tcp_serv_addr; /* socket information */
* Try to connect to host for max_retry_time at retry_time intervals.
*/
BSOCK *
-bnet_connect(JCR *jcr, int retry_interval, int max_retry_time, char *name,
+bnet_connect(JCR *jcr, int retry_interval, int max_retry_time, const char *name,
char *host, char *service, int port, int verbose)
{
int i;
* 1 on success
*/
int
-bnet_fsend(BSOCK *bs, char *fmt, ...)
+bnet_fsend(BSOCK *bs, const char *fmt, ...)
{
va_list arg_ptr;
int maxlen;
* This probably should be done in net_open
*/
BSOCK *
-init_bsock(JCR *jcr, int sockfd, char *who, char *host, int port,
+init_bsock(JCR *jcr, int sockfd, const char *who, char *host, int port,
struct sockaddr_in *client_addr)
{
BSOCK *bsock = (BSOCK *)malloc(sizeof(BSOCK));