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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
b2bd10d4
Commit
b2bd10d4
authored
Jan 17, 2016
by
Vicențiu Ciorbaru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MDEV-9427] Server does not build on OpenSUSE 42.1
Changed code to comply to C90 standard.
parent
6d3ffd2e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
mysys/my_addr_resolve.c
mysys/my_addr_resolve.c
+9
-7
No files found.
mysys/my_addr_resolve.c
View file @
b2bd10d4
...
...
@@ -148,10 +148,6 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc)
char
input
[
32
];
size_t
len
;
len
=
my_snprintf
(
input
,
sizeof
(
input
),
"%p
\n
"
,
ptr
-
offset
);
if
(
write
(
in
[
1
],
input
,
len
)
<=
0
)
return
1
;
ssize_t
total_bytes_read
=
0
;
ssize_t
extra_bytes_read
=
0
;
...
...
@@ -160,6 +156,14 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc)
FD_ZERO
(
&
set
);
FD_SET
(
out
[
0
],
&
set
);
int
filename_start
=
-
1
;
int
line_number_start
=
-
1
;
ssize_t
i
;
len
=
my_snprintf
(
input
,
sizeof
(
input
),
"%p
\n
"
,
ptr
-
offset
);
if
(
write
(
in
[
1
],
input
,
len
)
<=
0
)
return
1
;
/* 10 ms should be plenty of time for addr2line to issue a response. */
timeout
.
tv_sec
=
0
;
timeout
.
tv_usec
=
10000
;
...
...
@@ -177,12 +181,10 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc)
if
(
total_bytes_read
==
0
)
return
1
;
int
filename_start
=
-
1
;
int
line_number_start
=
-
1
;
/* Go through the addr2line response and get the required data.
The response is structured in 2 lnes. The first line contains the function
name, while the second one contains <filename>:<line number> */
for
(
ssize_t
i
=
0
;
i
<
total_bytes_read
;
i
++
)
{
for
(
i
=
0
;
i
<
total_bytes_read
;
i
++
)
{
if
(
output
[
i
]
==
'\n'
)
{
filename_start
=
i
+
1
;
output
[
i
]
=
'\0'
;
...
...
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