]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/bnet.c
Fix reporting jobs from state file + misc
[bacula/bacula] / bacula / src / lib / bnet.c
index 6a4a15c0b11b22f72048f06a3ebcc9a7f2e0be72..a95d1e5cb44bfb1157b15c9f8fad5770e7980d59 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "bacula.h"
 #include "jcr.h"
+#include <netdb.h>
 
 extern time_t watchdog_time;
 
@@ -496,13 +497,10 @@ bnet_wait_data_intr(BSOCK *bsock, int sec)
 #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:
@@ -579,7 +577,7 @@ Wanted %d got %d bytes for s_addr.\n"), sizeof(inaddr.s_addr), hp->h_length);
  *  ***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 */
@@ -636,7 +634,7 @@ bnet_open(JCR *jcr, char *name, char *host, char *service, int port, int *fatal)
  * 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;
@@ -682,7 +680,7 @@ char *bnet_strerror(BSOCK *bsock)
  *          1 on success
  */
 int
-bnet_fsend(BSOCK *bs, char *fmt, ...)
+bnet_fsend(BSOCK *bs, const char *fmt, ...)
 {
    va_list arg_ptr;
    int maxlen;
@@ -823,7 +821,7 @@ char *bnet_sig_to_ascii(BSOCK *bs)
  *  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));