Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
f3513a79
Commit
f3513a79
authored
Oct 21, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more snprintf...
parent
63920158
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
126 additions
and
126 deletions
+126
-126
ndb/src/common/debugger/EventLogger.cpp
ndb/src/common/debugger/EventLogger.cpp
+105
-105
ndb/src/common/logger/FileLogHandler.cpp
ndb/src/common/logger/FileLogHandler.cpp
+2
-2
ndb/src/common/logger/LogHandler.cpp
ndb/src/common/logger/LogHandler.cpp
+2
-2
ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp
ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp
+1
-1
ndb/src/common/logger/loggertest/LoggerUnitTest.cpp
ndb/src/common/logger/loggertest/LoggerUnitTest.cpp
+1
-1
ndb/src/common/util/File.cpp
ndb/src/common/util/File.cpp
+2
-2
ndb/src/common/util/NdbErrHnd.cpp
ndb/src/common/util/NdbErrHnd.cpp
+8
-8
ndb/src/mgmsrv/ConfigInfo.cpp
ndb/src/mgmsrv/ConfigInfo.cpp
+4
-4
ndb/test/ndbapi/userInterface.cpp
ndb/test/ndbapi/userInterface.cpp
+1
-1
No files found.
ndb/src/common/debugger/EventLogger.cpp
View file @
f3513a79
This diff is collapsed.
Click to expand it.
ndb/src/common/logger/FileLogHandler.cpp
View file @
f3513a79
...
@@ -153,11 +153,11 @@ FileLogHandler::createNewFile()
...
@@ -153,11 +153,11 @@ FileLogHandler::createNewFile()
if
(
fileNo
>=
m_maxNoFiles
)
if
(
fileNo
>=
m_maxNoFiles
)
{
{
fileNo
=
1
;
fileNo
=
1
;
::
snprintf
(
newName
,
sizeof
(
newName
),
BaseString
::
snprintf
(
newName
,
sizeof
(
newName
),
"%s.%d"
,
m_pLogFile
->
getName
(),
fileNo
);
"%s.%d"
,
m_pLogFile
->
getName
(),
fileNo
);
break
;
break
;
}
}
::
snprintf
(
newName
,
sizeof
(
newName
),
BaseString
::
snprintf
(
newName
,
sizeof
(
newName
),
"%s.%d"
,
m_pLogFile
->
getName
(),
fileNo
++
);
"%s.%d"
,
m_pLogFile
->
getName
(),
fileNo
++
);
}
while
(
File_class
::
exists
(
newName
));
}
while
(
File_class
::
exists
(
newName
));
...
...
ndb/src/common/logger/LogHandler.cpp
View file @
f3513a79
...
@@ -45,7 +45,7 @@ LogHandler::getDefaultHeader(char* pStr, const char* pCategory,
...
@@ -45,7 +45,7 @@ LogHandler::getDefaultHeader(char* pStr, const char* pCategory,
Logger
::
LoggerLevel
level
)
const
Logger
::
LoggerLevel
level
)
const
{
{
char
time
[
MAX_DATE_TIME_HEADER_LENGTH
];
char
time
[
MAX_DATE_TIME_HEADER_LENGTH
];
::
snprintf
(
pStr
,
MAX_HEADER_LENGTH
,
"%s [%s] %s -- "
,
BaseString
::
snprintf
(
pStr
,
MAX_HEADER_LENGTH
,
"%s [%s] %s -- "
,
getTimeAsString
((
char
*
)
time
),
getTimeAsString
((
char
*
)
time
),
pCategory
,
pCategory
,
Logger
::
LoggerLevelNames
[
level
]);
Logger
::
LoggerLevelNames
[
level
]);
...
@@ -84,7 +84,7 @@ LogHandler::getTimeAsString(char* pStr) const
...
@@ -84,7 +84,7 @@ LogHandler::getTimeAsString(char* pStr) const
tm_now
=
::
localtime
(
&
now
);
//uses the "current" timezone
tm_now
=
::
localtime
(
&
now
);
//uses the "current" timezone
#endif
#endif
::
snprintf
(
pStr
,
MAX_DATE_TIME_HEADER_LENGTH
,
BaseString
::
snprintf
(
pStr
,
MAX_DATE_TIME_HEADER_LENGTH
,
m_pDateTimeFormat
,
m_pDateTimeFormat
,
tm_now
->
tm_year
+
1900
,
tm_now
->
tm_year
+
1900
,
tm_now
->
tm_mon
+
1
,
//month is [0,11]. +1 -> [1,12]
tm_now
->
tm_mon
+
1
,
//month is [0,11]. +1 -> [1,12]
...
...
ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp
View file @
f3513a79
...
@@ -128,7 +128,7 @@ LogHandlerListUnitTest::testTraverseNext(const char* msg)
...
@@ -128,7 +128,7 @@ LogHandlerListUnitTest::testTraverseNext(const char* msg)
{
{
char
*
str
=
new
char
[
3
];
char
*
str
=
new
char
[
3
];
pHandlers
[
i
]
=
new
ConsoleLogHandler
();
pHandlers
[
i
]
=
new
ConsoleLogHandler
();
::
snprintf
(
str
,
3
,
"%d"
,
i
);
BaseString
::
snprintf
(
str
,
3
,
"%d"
,
i
);
pHandlers
[
i
]
->
setDateTimeFormat
(
str
);
pHandlers
[
i
]
->
setDateTimeFormat
(
str
);
list
.
add
(
pHandlers
[
i
]);
list
.
add
(
pHandlers
[
i
]);
}
}
...
...
ndb/src/common/logger/loggertest/LoggerUnitTest.cpp
View file @
f3513a79
...
@@ -86,7 +86,7 @@ NDB_COMMAND(loggertest, "loggertest", "loggertest -console | -file",
...
@@ -86,7 +86,7 @@ NDB_COMMAND(loggertest, "loggertest", "loggertest -console | -file",
{
{
ndbout
<<
"-- "
<<
" Test "
<<
i
+
1
ndbout
<<
"-- "
<<
" Test "
<<
i
+
1
<<
" ["
<<
testCases
[
i
].
name
<<
"] --"
<<
endl
;
<<
" ["
<<
testCases
[
i
].
name
<<
"] --"
<<
endl
;
::
snprintf
(
str
,
256
,
"%s %s %s %d"
,
"Logging "
,
BaseString
::
snprintf
(
str
,
256
,
"%s %s %s %d"
,
"Logging "
,
testCases
[
i
].
name
,
" message "
,
i
);
testCases
[
i
].
name
,
" message "
,
i
);
if
(
testCases
[
i
].
test
(
str
))
if
(
testCases
[
i
].
test
(
str
))
{
{
...
...
ndb/src/common/util/File.cpp
View file @
f3513a79
...
@@ -83,7 +83,7 @@ File_class::File_class(const char* aFileName, const char* mode) :
...
@@ -83,7 +83,7 @@ File_class::File_class(const char* aFileName, const char* mode) :
m_file
(
NULL
),
m_file
(
NULL
),
m_fileMode
(
mode
)
m_fileMode
(
mode
)
{
{
::
snprintf
(
m_fileName
,
MAX_FILE_NAME_SIZE
,
aFileName
);
BaseString
::
snprintf
(
m_fileName
,
MAX_FILE_NAME_SIZE
,
aFileName
);
}
}
bool
bool
...
@@ -99,7 +99,7 @@ File_class::open(const char* aFileName, const char* mode)
...
@@ -99,7 +99,7 @@ File_class::open(const char* aFileName, const char* mode)
/**
/**
* Only copy if it's not the same string
* Only copy if it's not the same string
*/
*/
::
snprintf
(
m_fileName
,
MAX_FILE_NAME_SIZE
,
aFileName
);
BaseString
::
snprintf
(
m_fileName
,
MAX_FILE_NAME_SIZE
,
aFileName
);
}
}
m_fileMode
=
mode
;
m_fileMode
=
mode
;
bool
rc
=
true
;
bool
rc
=
true
;
...
...
ndb/src/common/util/NdbErrHnd.cpp
View file @
f3513a79
...
@@ -346,15 +346,15 @@ extern "C" OSBOOLEAN ndb_err_hnd(bool user_called,
...
@@ -346,15 +346,15 @@ extern "C" OSBOOLEAN ndb_err_hnd(bool user_called,
file_name
=
"ose_err.h"
;
file_name
=
"ose_err.h"
;
}
}
snprintf
(
error_message
.
header1
,
BaseString
::
snprintf
(
error_message
.
header1
,
BUFSIZE
,
BUFSIZE
,
"This is the OSE Example System Error handler
\r\n
"
);
"This is the OSE Example System Error handler
\r\n
"
);
snprintf
(
error_message
.
err_hnd_file
,
BaseString
::
snprintf
(
error_message
.
err_hnd_file
,
BUFSIZE
,
BUFSIZE
,
"located in: "
__FILE__
"
\r\n
"
);
"located in: "
__FILE__
"
\r\n
"
);
snprintf
(
error_message
.
header2
,
BaseString
::
snprintf
(
error_message
.
header2
,
BUFSIZE
,
BUFSIZE
,
"An Error has been reported:
\r\n
"
);
"An Error has been reported:
\r\n
"
);
...
@@ -371,28 +371,28 @@ extern "C" OSBOOLEAN ndb_err_hnd(bool user_called,
...
@@ -371,28 +371,28 @@ extern "C" OSBOOLEAN ndb_err_hnd(bool user_called,
user_called
);
user_called
);
}
}
snprintf
(
error_message
.
error_code_line
,
BaseString
::
snprintf
(
error_message
.
error_code_line
,
BUFSIZE
,
BUFSIZE
,
"error code: 0x%08x
\r\n
"
,
"error code: 0x%08x
\r\n
"
,
error_code
);
error_code
);
snprintf
(
error_message
.
subcode_line
,
BaseString
::
snprintf
(
error_message
.
subcode_line
,
BUFSIZE
,
BUFSIZE
,
" subcode: %s (0x%08x)
\r\n
"
,
" subcode: %s (0x%08x)
\r\n
"
,
subcode_mnemonic
,
subcode_mnemonic
,
(
subcode
<<
16
));
(
subcode
<<
16
));
snprintf
(
error_message
.
product_line
,
BaseString
::
snprintf
(
error_message
.
product_line
,
BUFSIZE
,
BUFSIZE
,
" product: %s
\r\n
"
,
" product: %s
\r\n
"
,
product_name
);
product_name
);
snprintf
(
error_message
.
header_file_line
,
BaseString
::
snprintf
(
error_message
.
header_file_line
,
BUFSIZE
,
BUFSIZE
,
" header file: %s
\r\n
"
,
" header file: %s
\r\n
"
,
file_name
);
file_name
);
snprintf
(
error_message
.
extra_line
,
BaseString
::
snprintf
(
error_message
.
extra_line
,
BUFSIZE
,
BUFSIZE
,
"extra: 0x%08x
\r\n
"
,
"extra: 0x%08x
\r\n
"
,
extra
);
extra
);
...
...
ndb/src/mgmsrv/ConfigInfo.cpp
View file @
f3513a79
...
@@ -3405,9 +3405,9 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>§ions,
...
@@ -3405,9 +3405,9 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>§ions,
s
.
m_sectionType
=
BaseString
(
"TCP"
);
s
.
m_sectionType
=
BaseString
(
"TCP"
);
s
.
m_sectionData
=
new
Properties
(
true
);
s
.
m_sectionData
=
new
Properties
(
true
);
char
buf
[
16
];
char
buf
[
16
];
snprintf
(
buf
,
sizeof
(
buf
),
"%u"
,
nodeId1
);
BaseString
::
snprintf
(
buf
,
sizeof
(
buf
),
"%u"
,
nodeId1
);
s
.
m_sectionData
->
put
(
"NodeId1"
,
buf
);
s
.
m_sectionData
->
put
(
"NodeId1"
,
buf
);
snprintf
(
buf
,
sizeof
(
buf
),
"%u"
,
nodeId2
);
BaseString
::
snprintf
(
buf
,
sizeof
(
buf
),
"%u"
,
nodeId2
);
s
.
m_sectionData
->
put
(
"NodeId2"
,
buf
);
s
.
m_sectionData
->
put
(
"NodeId2"
,
buf
);
sections
.
push_back
(
s
);
sections
.
push_back
(
s
);
}
}
...
@@ -3422,9 +3422,9 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>§ions,
...
@@ -3422,9 +3422,9 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>§ions,
s
.
m_sectionType
=
BaseString
(
"TCP"
);
s
.
m_sectionType
=
BaseString
(
"TCP"
);
s
.
m_sectionData
=
new
Properties
(
true
);
s
.
m_sectionData
=
new
Properties
(
true
);
char
buf
[
16
];
char
buf
[
16
];
snprintf
(
buf
,
sizeof
(
buf
),
"%u"
,
nodeId1
);
BaseString
::
snprintf
(
buf
,
sizeof
(
buf
),
"%u"
,
nodeId1
);
s
.
m_sectionData
->
put
(
"NodeId1"
,
buf
);
s
.
m_sectionData
->
put
(
"NodeId1"
,
buf
);
snprintf
(
buf
,
sizeof
(
buf
),
"%u"
,
nodeId2
);
BaseString
::
snprintf
(
buf
,
sizeof
(
buf
),
"%u"
,
nodeId2
);
s
.
m_sectionData
->
put
(
"NodeId2"
,
buf
);
s
.
m_sectionData
->
put
(
"NodeId2"
,
buf
);
sections
.
push_back
(
s
);
sections
.
push_back
(
s
);
}
}
...
...
ndb/test/ndbapi/userInterface.cpp
View file @
f3513a79
...
@@ -103,7 +103,7 @@ void showTime()
...
@@ -103,7 +103,7 @@ void showTime()
now
=
::
time
((
time_t
*
)
NULL
);
now
=
::
time
((
time_t
*
)
NULL
);
tm_now
=
::
gmtime
(
&
now
);
tm_now
=
::
gmtime
(
&
now
);
::
snprintf
(
buf
,
128
,
BaseString
::
snprintf
(
buf
,
128
,
"%d-%.2d-%.2d %.2d:%.2d:%.2d"
,
"%d-%.2d-%.2d %.2d:%.2d:%.2d"
,
tm_now
->
tm_year
+
1900
,
tm_now
->
tm_year
+
1900
,
tm_now
->
tm_mon
,
tm_now
->
tm_mon
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment