Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
cde24601
Commit
cde24601
authored
8 years ago
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify resize_receive_buffer.
parent
cee5c346
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
16 deletions
+9
-16
babeld.c
babeld.c
+9
-16
No files found.
babeld.c
View file @
cde24601
...
@@ -951,26 +951,19 @@ schedule_interfaces_check(int msecs, int override)
...
@@ -951,26 +951,19 @@ schedule_interfaces_check(int msecs, int override)
int
int
resize_receive_buffer
(
int
size
)
resize_receive_buffer
(
int
size
)
{
{
unsigned
char
*
new
;
if
(
size
<=
receive_buffer_size
)
if
(
size
<=
receive_buffer_size
)
return
0
;
return
0
;
if
(
receive_buffer
==
NULL
)
{
new
=
realloc
(
receive_buffer
,
size
);
receive_buffer
=
malloc
(
size
);
if
(
new
==
NULL
)
{
if
(
receive_buffer
==
NULL
)
{
perror
(
"realloc(receive_buffer)"
);
perror
(
"malloc(receive_buffer)"
);
return
-
1
;
return
-
1
;
}
receive_buffer_size
=
size
;
}
else
{
unsigned
char
*
new
;
new
=
realloc
(
receive_buffer
,
size
);
if
(
new
==
NULL
)
{
perror
(
"realloc(receive_buffer)"
);
return
-
1
;
}
receive_buffer
=
new
;
receive_buffer_size
=
size
;
}
}
receive_buffer
=
new
;
receive_buffer_size
=
size
;
return
1
;
return
1
;
}
}
...
...
This diff is collapsed.
Click to expand it.
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