add compile flad -DSNPRINTF_RETURN_TRUNC on hp ux 11

    remove compiler warning
    patch for my_vsnprintf not dully implemented
    patch for platfroms that return -1 on snprintf overflow
    compile fix for hpux
parent 6e6f610f
...@@ -1039,8 +1039,8 @@ case $SYSTEM_TYPE in ...@@ -1039,8 +1039,8 @@ case $SYSTEM_TYPE in
;; ;;
*hpux11.*) *hpux11.*)
echo "Enabling workarounds for hpux 11" echo "Enabling workarounds for hpux 11"
CFLAGS="$CFLAGS -DHPUX11 -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT" CFLAGS="$CFLAGS -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
CXXFLAGS="$CXXFLAGS -DHPUX11 -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -D_INCLUDE_LONGLONG -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT" CXXFLAGS="$CXXFLAGS -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -D_INCLUDE_LONGLONG -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
if test "$with_named_thread" = "no" if test "$with_named_thread" = "no"
then then
echo "Using --with-named-thread=-lpthread" echo "Using --with-named-thread=-lpthread"
......
...@@ -139,7 +139,7 @@ rl_add_slash(char *path, char *p, size_t p_len) ...@@ -139,7 +139,7 @@ rl_add_slash(char *path, char *p, size_t p_len)
struct stat Sb; struct stat Sb;
if (stat(path, &Sb) >= 0) { if (stat(path, &Sb) >= 0) {
int len= strlen(p); size_t len= strlen(p);
if (len+1 < p_len) { if (len+1 < p_len) {
p[len]= S_ISDIR(Sb.st_mode) ? '/' : ' '; p[len]= S_ISDIR(Sb.st_mode) ? '/' : ' ';
p[len+1]= 0; p[len+1]= 0;
......
...@@ -35,7 +35,11 @@ basestring_snprintf(char *str, size_t size, const char *format, ...) ...@@ -35,7 +35,11 @@ basestring_snprintf(char *str, size_t size, const char *format, ...)
#define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) vsnprintf(a,b,c,d) #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) vsnprintf(a,b,c,d)
#else #else
#define SNPRINTF_RETURN_TRUNC #define SNPRINTF_RETURN_TRUNC
#define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) my_vsnprintf(a,b,c,d) /* #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) my_vsnprintf(a,b,c,d)
* we would like to use my_vsnprintf but it does not have enough features
* Let's hope vsnprintf works anyways
*/
#define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) vsnprintf(a,b,c,d)
extern int my_vsnprintf(char *str, size_t size, const char *format, va_list ap); extern int my_vsnprintf(char *str, size_t size, const char *format, va_list ap);
#endif #endif
#ifdef SNPRINTF_RETURN_TRUNC #ifdef SNPRINTF_RETURN_TRUNC
...@@ -46,7 +50,7 @@ basestring_vsnprintf(char *str, size_t size, const char *format, va_list ap) ...@@ -46,7 +50,7 @@ basestring_vsnprintf(char *str, size_t size, const char *format, va_list ap)
{ {
int ret= BASESTRING_VSNPRINTF_FUNC(str, size, format, ap); int ret= BASESTRING_VSNPRINTF_FUNC(str, size, format, ap);
#ifdef SNPRINTF_RETURN_TRUNC #ifdef SNPRINTF_RETURN_TRUNC
if (ret == size-1) { if (ret == size-1 || ret == -1) {
ret= BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf, ret= BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf,
sizeof(basestring_vsnprintf_buf), sizeof(basestring_vsnprintf_buf),
format, ap); format, ap);
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
// //
//=========================================================================== //===========================================================================
#include <kernel_types.h> #include <kernel_types.h>
#include <TransporterRegistry.hpp>
extern class JobTable globalJobTable; extern class JobTable globalJobTable;
extern class TimeQueue globalTimeQueue; extern class TimeQueue globalTimeQueue;
......
...@@ -773,8 +773,10 @@ MgmApiSession::setClusterLogLevel(Parser<MgmApiSession>::Context &, ...@@ -773,8 +773,10 @@ MgmApiSession::setClusterLogLevel(Parser<MgmApiSession>::Context &,
/* XXX should use constants for this value */ /* XXX should use constants for this value */
if(level > 15) { if(level > 15) {
errorString.assign("Invalied loglevel"); m_output->println("set cluster loglevel reply");
goto error; m_output->println("result: Invalid loglevel");
m_output->println("");
return;
} }
EventSubscribeReq req; EventSubscribeReq req;
...@@ -786,11 +788,6 @@ MgmApiSession::setClusterLogLevel(Parser<MgmApiSession>::Context &, ...@@ -786,11 +788,6 @@ MgmApiSession::setClusterLogLevel(Parser<MgmApiSession>::Context &,
m_output->println("set cluster loglevel reply"); m_output->println("set cluster loglevel reply");
m_output->println("result: Ok"); m_output->println("result: Ok");
m_output->println(""); m_output->println("");
return;
error:
m_output->println("set cluster loglevel reply");
m_output->println("result: %s", errorString.c_str());
m_output->println("");
} }
void void
...@@ -807,8 +804,10 @@ MgmApiSession::setLogLevel(Parser<MgmApiSession>::Context &, ...@@ -807,8 +804,10 @@ MgmApiSession::setLogLevel(Parser<MgmApiSession>::Context &,
/* XXX should use constants for this value */ /* XXX should use constants for this value */
if(level > 15) { if(level > 15) {
errorString.assign("Invalied loglevel"); m_output->println("set loglevel reply");
goto error; m_output->println("result: Invalid loglevel", errorString.c_str());
m_output->println("");
return;
} }
EventSubscribeReq req; EventSubscribeReq req;
...@@ -820,11 +819,6 @@ MgmApiSession::setLogLevel(Parser<MgmApiSession>::Context &, ...@@ -820,11 +819,6 @@ MgmApiSession::setLogLevel(Parser<MgmApiSession>::Context &,
m_output->println("set loglevel reply"); m_output->println("set loglevel reply");
m_output->println("result: Ok"); m_output->println("result: Ok");
m_output->println(""); m_output->println("");
return;
error:
m_output->println("set loglevel reply");
m_output->println("result: %s", errorString.c_str());
m_output->println("");
} }
void void
......
...@@ -47,15 +47,13 @@ ...@@ -47,15 +47,13 @@
* Column * Column
*/ */
NdbColumnImpl::NdbColumnImpl() NdbColumnImpl::NdbColumnImpl()
: NdbDictionary::Column(* this), m_facade(this), : NdbDictionary::Column(* this), m_attrId(-1), m_facade(this)
m_attrId(-1)
{ {
init(); init();
} }
NdbColumnImpl::NdbColumnImpl(NdbDictionary::Column & f) NdbColumnImpl::NdbColumnImpl(NdbDictionary::Column & f)
: NdbDictionary::Column(* this), m_facade(&f), : NdbDictionary::Column(* this), m_attrId(-1), m_facade(&f)
m_attrId(-1)
{ {
init(); init();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment