Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
426ecfd1
Commit
426ecfd1
authored
18 years ago
by
Yang Tse
Browse files
Options
Downloads
Patches
Plain Diff
fix comments and renumber rlimit return codes
parent
4913baed
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/libtest/lib518.c
+9
-7
9 additions, 7 deletions
tests/libtest/lib518.c
with
9 additions
and
7 deletions
tests/libtest/lib518.c
+
9
−
7
View file @
426ecfd1
...
...
@@ -188,8 +188,9 @@ static int rlimit(int keep_open)
/*
* verify that soft limit is higher than NUM_NEEDED,
* number of file descriptors we would try to open
* plus SAFETY_MARGIN to not exhaust file pool
* which is the number of file descriptors we would
* try to open plus SAFETY_MARGIN to not exhaust the
* file descriptor pool
*/
num_open
.
rlim_cur
=
NUM_NEEDED
;
...
...
@@ -226,7 +227,7 @@ static int rlimit(int keep_open)
if
(
!
memchunk
)
{
store_errmsg
(
"memchunk, malloc() failed"
,
our_errno
());
fprintf
(
stderr
,
"%s
\n
"
,
msgbuff
);
return
-
7
;
return
-
5
;
}
/* initialize it to fight lazy allocation */
...
...
@@ -247,7 +248,7 @@ static int rlimit(int keep_open)
store_errmsg
(
strbuff
,
0
);
fprintf
(
stderr
,
"%s
\n
"
,
msgbuff
);
free
(
memchunk
);
return
-
8
;
return
-
6
;
}
/* allocate array for file descriptors */
...
...
@@ -260,7 +261,7 @@ static int rlimit(int keep_open)
store_errmsg
(
"fd, malloc() failed"
,
our_errno
());
fprintf
(
stderr
,
"%s
\n
"
,
msgbuff
);
free
(
memchunk
);
return
-
9
;
return
-
7
;
}
/* initialize it to fight lazy allocation */
...
...
@@ -283,7 +284,7 @@ static int rlimit(int keep_open)
free
(
fd
);
fd
=
NULL
;
free
(
memchunk
);
return
-
10
;
return
-
8
;
}
/* create a bunch of file descriptors */
...
...
@@ -313,7 +314,7 @@ static int rlimit(int keep_open)
free
(
fd
);
fd
=
NULL
;
free
(
memchunk
);
return
-
11
;
return
-
9
;
}
...
...
@@ -328,6 +329,7 @@ static int rlimit(int keep_open)
free
(
memchunk
);
/* close file descriptors unless instructed to keep them */
if
(
!
keep_open
)
{
close_file_descriptors
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment