]> git.mxchange.org Git - flightgear.git/blobdiff - src/NetworkOLK/net_send.cxx
Added write-all parameter to save command. If set to true, the
[flightgear.git] / src / NetworkOLK / net_send.cxx
index b417c1d725a40b75d7cfdb788884e1bf823940d4..2465d843ccdd069a40e205bae2cc898ca7fc1d02 100644 (file)
@@ -41,6 +41,7 @@
 #include <Cockpit/hud.hxx>
 #include <plib/ssg.h>
 #include <Main/globals.hxx>
+#include <Main/viewmgr.hxx>
 
 //#define printf //
 
@@ -68,13 +69,16 @@ int result;
 
 //extern const char *const sys_errlist[];
 
+/* -dlw- I fixed a few of the cases, but please make non externally used */
+/*  symbols static to avoid possible linker conflicts */
 int current_port  = 10000; 
 u_short base_port = 10000;
 u_short end_port  = 10010;
-int verbose = 0;
-struct hostent *host_info, *f_host_info;
-struct servent *service_info;
-struct utsname myname;
+
+static int verbose = 0;
+static struct hostent *host_info, *f_host_info;
+static struct servent *service_info;
+static struct utsname myname;
 
 /* Program-stuff */
 int i, j;
@@ -255,7 +259,7 @@ void fgd_init(void){
 /* determinating the source/sending host */
    if (uname(&myname) == 0) strcpy(src_host , myname.nodename);   
    printf("MCP: I'm running on HOST : %s  ", src_host);
-   if (host_info = gethostbyname( src_host)) {
+   if ( (host_info = gethostbyname( src_host)) != NULL ) {
      bcopy(host_info->h_addr, (char *)&address.sin_addr,host_info->h_length);
      strcpy((char *) fgd_mcp_ip, (char *) inet_ntoa(address.sin_addr));
      }
@@ -263,7 +267,7 @@ void fgd_init(void){
    FGFS_host = src_host;
 /* resolving the destination host, here fgd's host */   
    if (verbose == 2) printf("     Resolving default DEAMON: %s ->", fgd_host);
-   if (host_info = gethostbyname( fgd_host)) {
+   if ( (host_info = gethostbyname( fgd_host)) != NULL ) {
      bcopy(host_info->h_addr, (char *)&address.sin_addr,host_info->h_length);
      strcpy((char *) fgd_ip, (char *) inet_ntoa(address.sin_addr));
      if (verbose == 2) {
@@ -291,7 +295,7 @@ int net_resolv_fgd( char *fgd_host_check ) {
 /* resolving the destination host, here fgd's host */   
    net_r = 0;
    if (verbose == 2) printf("     Resolving default DEAMON: %s ->", fgd_host_check);
-   if (host_info = gethostbyname( fgd_host_check)) {
+   if ( (host_info = gethostbyname( fgd_host_check)) != NULL ) {
      bcopy(host_info->h_addr, (char *)&address.sin_addr,host_info->h_length);
      strcpy((char *) fgd_ip_check, (char *) inet_ntoa(address.sin_addr));
      fgd_ip = fgd_ip_check;