Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Xin Wang
codes-dev
Commits
e58af845
Commit
e58af845
authored
Feb 18, 2014
by
Jonathan Jenkins
Browse files
bad list manip in lp-io
parent
ccd9b778
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/util/lp-io.c
View file @
e58af845
...
...
@@ -101,7 +101,7 @@ int lp_io_write(tw_lpid gid, char* identifier, int size, void* buffer)
}
int
lp_io_write_rev
(
tw_lpid
gid
,
char
*
identifier
){
struct
identifier
*
id
;
struct
identifier
*
id
,
*
id_prev
;
struct
io_buffer
*
buf
,
*
buf_prev
;
/* find given identifier */
...
...
@@ -112,10 +112,12 @@ int lp_io_write_rev(tw_lpid gid, char* identifier){
}
id
=
identifiers
;
while
(
id
&&
(
strcmp
(
identifier
,
id
->
identifier
)
!=
0
)){
id_prev
=
id
;
id
=
id
->
next
;
}
if
(
!
id
){
fprintf
(
stderr
,
"Error: identifier %s not found on reverse.
\n
"
,
identifier
);
fprintf
(
stderr
,
"Error: identifier %s not found on reverse for LP %lu."
,
identifier
,
gid
);
return
(
-
1
);
}
...
...
@@ -138,7 +140,12 @@ int lp_io_write_rev(tw_lpid gid, char* identifier){
if
(
id
->
buffers_count
==
0
){
/* seg faults caused with empty identifiers for some reason - remove
* this ID */
identifiers
=
id
->
next
;
if
(
id
==
identifiers
){
identifiers
=
id
->
next
;
}
else
{
id_prev
->
next
=
id
->
next
;
}
free
(
id
);
identifiers_count
--
;
}
...
...
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