Commit 60d179aa08783b931e3753800ee3fdfe84778ed2

Authored by Benjamin Renard
1 parent b4a6ef63
Exists in ubuntu

Ubuntu compilation OK

CMakeLists.txt
@@ -10,7 +10,7 @@ if( CMAKE_SIZEOF_VOID_P EQUAL 8 ) @@ -10,7 +10,7 @@ if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
10 #64 bits 10 #64 bits
11 MESSAGE( STATUS "64 bits" ) 11 MESSAGE( STATUS "64 bits" )
12 set(CMAKE_C_FLAGS_DEBUG "-ggdb -DLINUX -Dlinux -m64 -march=core2 -fPIC -D_REENTRANT -pthread") 12 set(CMAKE_C_FLAGS_DEBUG "-ggdb -DLINUX -Dlinux -m64 -march=core2 -fPIC -D_REENTRANT -pthread")
13 - set(CMAKE_C_FLAGS_RELEASE "-DLINUX -D_POSIX_SOURCE -Dlinux -m64 -march=core2 -fPIC -D_REENTRANT -pthread") 13 + set(CMAKE_C_FLAGS_RELEASE "-DLINUX -Dlinux -m64 -march=core2 -fPIC -D_REENTRANT -pthread")
14 set(CMAKE_CXX_FLAGS_DEBUG "-std=c++0x -fPIC -Wall -Wextra -ggdb -DLINUX -Dlinux -D_REENTRANT -malign-double -pthread") 14 set(CMAKE_CXX_FLAGS_DEBUG "-std=c++0x -fPIC -Wall -Wextra -ggdb -DLINUX -Dlinux -D_REENTRANT -malign-double -pthread")
15 set(CMAKE_CXX_FLAGS_RELEASE "-std=c++0x -Wall -Wextra -fPIC -DLINUX -Dlinux -D_REENTRANT -malign-double -pthread -O3 -DNDEBUG") 15 set(CMAKE_CXX_FLAGS_RELEASE "-std=c++0x -Wall -Wextra -fPIC -DLINUX -Dlinux -D_REENTRANT -malign-double -pthread -O3 -DNDEBUG")
16 set(USRLIB_DIR "/usr/lib64/:/usr/local/lib64/") 16 set(USRLIB_DIR "/usr/lib64/:/usr/local/lib64/")
@@ -32,7 +32,7 @@ if (EXISTS "/usr/include/tirpc") @@ -32,7 +32,7 @@ if (EXISTS "/usr/include/tirpc")
32 include_directories("/usr/include/tirpc") 32 include_directories("/usr/include/tirpc")
33 endif() 33 endif()
34 34
35 -if (EXISTS "/usr/lib64/libtirpc.so") 35 +if (EXISTS "/usr/lib/x86_64-linux-gnu/libtirpc.so")
36 set (TIRPC "tirpc") 36 set (TIRPC "tirpc")
37 else() 37 else()
38 set (TIRPC "") 38 set (TIRPC "")
src/DDClientLibC/INCLUDE/DD.h
@@ -141,3 +141,5 @@ extern int DD_AddDataSet(char *DataSetName, char *RemSetID, char *BaseName); @@ -141,3 +141,5 @@ extern int DD_AddDataSet(char *DataSetName, char *RemSetID, char *BaseName);
141 #define DD_FLOAT 2 141 #define DD_FLOAT 2
142 #define DD_DOUBLE 3 142 #define DD_DOUBLE 3
143 #define DD_CHAR 0 143 #define DD_CHAR 0
  144 +
  145 +int GetSocket();
src/DDClientLibCpp/DD_client.cc
@@ -203,8 +203,16 @@ int DD_Client::GetSocket() @@ -203,8 +203,16 @@ int DD_Client::GetSocket()
203 exit(1); 203 exit(1);
204 } 204 }
205 205
206 - fgets(RemSerName, PATHLENGTH-1, resfile);  
207 - fgets(line, PATHLENGTH-1, resfile); 206 + char *r = fgets(RemSerName, PATHLENGTH-1, resfile);
  207 + if (r == NULL) {
  208 + fprintf(stderr,"Cannot load server name in resource file\n");
  209 + exit(1);
  210 + }
  211 + r = fgets(line, PATHLENGTH-1, resfile);
  212 + if (r == NULL) {
  213 + fprintf(stderr,"Cannot load port in resource file\n");
  214 + exit(1);
  215 + }
208 fclose(resfile); 216 fclose(resfile);
209 217
210 RemSerName[strlen(RemSerName)-1] = '\0'; 218 RemSerName[strlen(RemSerName)-1] = '\0';
src/TOOLS/COMMON/DD_Access_cl.c
@@ -26,7 +26,7 @@ extern int SocketID; /* The socket is defined in DD_client.c */ @@ -26,7 +26,7 @@ extern int SocketID; /* The socket is defined in DD_client.c */
26 /*================= FUNCTIONS ================================*/ 26 /*================= FUNCTIONS ================================*/
27 27
28 /*------------------------ LoginRequest -------------------------------*/ 28 /*------------------------ LoginRequest -------------------------------*/
29 -LoginRequest(char *UserPasswd, char *DDUserName, char *Host) 29 +int LoginRequest(char *UserPasswd, char *DDUserName, char *Host)
30 { 30 {
31 static caddr_t buf = NULL; 31 static caddr_t buf = NULL;
32 static XDR xdrs; 32 static XDR xdrs;
src/TOOLS/DDCheckUser/DD_Check.c
@@ -12,9 +12,11 @@ @@ -12,9 +12,11 @@
12 #include <stdio.h> 12 #include <stdio.h>
13 #include <stdlib.h> 13 #include <stdlib.h>
14 #include <string.h> 14 #include <string.h>
  15 +#include <unistd.h>
  16 +
15 #include <DD_Access.h> 17 #include <DD_Access.h>
16 18
17 -main (int argc, char *argv[]) 19 +int main (int argc, char *argv[])
18 /* 20 /*
19 * LocalID - the Unix ID if user, invoking this program 21 * LocalID - the Unix ID if user, invoking this program
20 * LogName - the DD login name for specific user 22 * LogName - the DD login name for specific user
src/TOOLS/DDHtmlLogin/DD_htmllogin.c
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 /*=========== Global Variables ===============================*/ 25 /*=========== Global Variables ===============================*/
26 26
27 27
28 -main (int argc, char *argv[]) 28 +int main (int argc, char *argv[])
29 { 29 {
30 int length; 30 int length;
31 char HostName[MAXHOSTLENGTH]; 31 char HostName[MAXHOSTLENGTH];