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
7df573ed
Commit
7df573ed
authored
May 12, 2004
by
tomas@mc05.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1
into mc05.(none):/space/tomas/mysql-4.1-ndb
parents
f586a85b
216c3a3b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
20 deletions
+26
-20
mysys/my_lock.c
mysys/my_lock.c
+6
-4
ndb/src/cw/cpcd/Process.cpp
ndb/src/cw/cpcd/Process.cpp
+20
-16
No files found.
mysys/my_lock.c
View file @
7df573ed
...
@@ -117,10 +117,12 @@ int my_lock(File fd, int locktype, my_off_t start, my_off_t length,
...
@@ -117,10 +117,12 @@ int my_lock(File fd, int locktype, my_off_t start, my_off_t length,
#if defined(HAVE_FCNTL)
#if defined(HAVE_FCNTL)
{
{
struct
flock
lock
;
struct
flock
lock
;
lock
.
l_type
=
(
short
)
locktype
;
lock
.
l_type
=
(
short
)
locktype
;
lock
.
l_whence
=
0L
;
lock
.
l_whence
=
SEEK_SET
;
lock
.
l_start
=
(
long
)
start
;
lock
.
l_start
=
(
off_t
)
start
;
lock
.
l_len
=
(
long
)
length
;
lock
.
l_len
=
(
off_t
)
length
;
if
(
MyFlags
&
MY_DONT_WAIT
)
if
(
MyFlags
&
MY_DONT_WAIT
)
{
{
if
(
fcntl
(
fd
,
F_SETLK
,
&
lock
)
!=
-
1
)
/* Check if we can lock */
if
(
fcntl
(
fd
,
F_SETLK
,
&
lock
)
!=
-
1
)
/* Check if we can lock */
...
...
ndb/src/cw/cpcd/Process.cpp
View file @
7df573ed
...
@@ -25,7 +25,9 @@
...
@@ -25,7 +25,9 @@
#include "CPCD.hpp"
#include "CPCD.hpp"
#include <pwd.h>
#include <pwd.h>
#ifdef HAVE_GETRLIMIT
#include <sys/resource.h>
#include <sys/resource.h>
#endif
void
void
CPCD
::
Process
::
print
(
FILE
*
f
){
CPCD
::
Process
::
print
(
FILE
*
f
){
...
@@ -205,6 +207,7 @@ setup_environment(const char *env) {
...
@@ -205,6 +207,7 @@ setup_environment(const char *env) {
static
static
int
int
set_ulimit
(
const
BaseString
&
pair
){
set_ulimit
(
const
BaseString
&
pair
){
#ifdef HAVE_GETRLIMIT
errno
=
0
;
errno
=
0
;
do
{
do
{
Vector
<
BaseString
>
list
;
Vector
<
BaseString
>
list
;
...
@@ -213,41 +216,42 @@ set_ulimit(const BaseString & pair){
...
@@ -213,41 +216,42 @@ set_ulimit(const BaseString & pair){
break
;
break
;
}
}
int
res
ource
=
0
;
int
res
;
rlim_t
value
=
RLIM_INFINITY
;
rlim_t
value
=
RLIM_INFINITY
;
if
(
!
(
list
[
1
].
trim
()
==
"unlimited"
)){
if
(
!
(
list
[
1
].
trim
()
==
"unlimited"
)){
value
=
atoi
(
list
[
1
].
c_str
());
value
=
atoi
(
list
[
1
].
c_str
());
}
}
struct
rlimit
rlp
;
#define _RLIMIT_FIX(x) { res = getrlimit(x,&rlp); if(!res){ rlp.rlim_cur = value; res = setrlimit(x, &rlp); }}
if
(
list
[
0
].
trim
()
==
"c"
){
if
(
list
[
0
].
trim
()
==
"c"
){
resource
=
RLIMIT_CORE
;
_RLIMIT_FIX
(
RLIMIT_CORE
)
;
}
else
if
(
list
[
0
]
==
"d"
){
}
else
if
(
list
[
0
]
==
"d"
){
resource
=
RLIMIT_DATA
;
_RLIMIT_FIX
(
RLIMIT_DATA
)
;
}
else
if
(
list
[
0
]
==
"f"
){
}
else
if
(
list
[
0
]
==
"f"
){
resource
=
RLIMIT_FSIZE
;
_RLIMIT_FIX
(
RLIMIT_FSIZE
)
;
}
else
if
(
list
[
0
]
==
"n"
){
}
else
if
(
list
[
0
]
==
"n"
){
resource
=
RLIMIT_NOFILE
;
_RLIMIT_FIX
(
RLIMIT_NOFILE
)
;
}
else
if
(
list
[
0
]
==
"s"
){
}
else
if
(
list
[
0
]
==
"s"
){
resource
=
RLIMIT_STACK
;
_RLIMIT_FIX
(
RLIMIT_STACK
)
;
}
else
if
(
list
[
0
]
==
"t"
){
}
else
if
(
list
[
0
]
==
"t"
){
resource
=
RLIMIT_CPU
;
_RLIMIT_FIX
(
RLIMIT_CPU
)
;
}
else
{
}
else
{
errno
=
EINVAL
;
errno
=
EINVAL
;
break
;
break
;
}
}
struct
rlimit
rlp
;
if
(
!
res
)
if
(
getrlimit
(
resource
,
&
rlp
)
!=
0
){
break
;
break
;
}
rlp
.
rlim_cur
=
value
;
if
(
setrlimit
(
resource
,
&
rlp
)
!=
0
){
break
;
}
return
0
;
return
0
;
}
while
(
false
);
}
while
(
false
);
logger
.
error
(
"Unable to process ulimit: %s(%s)"
,
logger
.
error
(
"Unable to process ulimit: %s(%s)"
,
pair
.
c_str
(),
strerror
(
errno
));
pair
.
c_str
(),
strerror
(
errno
));
return
-
1
;
return
-
1
;
#else
return
0
;
// Maybe it's ok anyway...
#endif
}
}
void
void
...
...
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