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
cf39ab2f
Commit
cf39ab2f
authored
Feb 10, 2002
by
monty@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove uage of static variable from file locks.
parent
9ef8d489
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
11 deletions
+7
-11
mysql-test/mysql-test-run.sh
mysql-test/mysql-test-run.sh
+0
-1
sql/my_lock.c
sql/my_lock.c
+7
-10
No files found.
mysql-test/mysql-test-run.sh
View file @
cf39ab2f
...
@@ -266,7 +266,6 @@ fi
...
@@ -266,7 +266,6 @@ fi
[
-z
"
$COLUMNS
"
]
&&
COLUMNS
=
80
[
-z
"
$COLUMNS
"
]
&&
COLUMNS
=
80
E
=
`
$EXPR
$COLUMNS
- 8
`
E
=
`
$EXPR
$COLUMNS
- 8
`
#DASH72=`$EXPR substr '------------------------------------------------------------------------' 1 $E`
DASH72
=
`
$ECHO
'------------------------------------------------------------------------'
|
$CUT
-c
1-
$E
`
DASH72
=
`
$ECHO
'------------------------------------------------------------------------'
|
$CUT
-c
1-
$E
`
# on source dist, we pick up freshly build executables
# on source dist, we pick up freshly build executables
...
...
sql/my_lock.c
View file @
cf39ab2f
...
@@ -26,10 +26,6 @@
...
@@ -26,10 +26,6 @@
#include <thr_alarm.h>
#include <thr_alarm.h>
#include <errno.h>
#include <errno.h>
#ifdef HAVE_FCNTL
static
struct
flock
lock
;
/* Must be static for sun-sparc */
#endif
/* Lock a part of a file */
/* Lock a part of a file */
int
my_lock
(
File
fd
,
int
locktype
,
my_off_t
start
,
my_off_t
length
,
myf
MyFlags
)
int
my_lock
(
File
fd
,
int
locktype
,
my_off_t
start
,
my_off_t
length
,
myf
MyFlags
)
...
@@ -37,24 +33,25 @@ int my_lock(File fd,int locktype,my_off_t start,my_off_t length,myf MyFlags)
...
@@ -37,24 +33,25 @@ int my_lock(File fd,int locktype,my_off_t start,my_off_t length,myf MyFlags)
thr_alarm_t
alarmed
;
thr_alarm_t
alarmed
;
ALARM
alarm_buff
;
ALARM
alarm_buff
;
uint
wait_for_alarm
;
uint
wait_for_alarm
;
struct
flock
m_lock
;
DBUG_ENTER
(
"my_lock"
);
DBUG_ENTER
(
"my_lock"
);
DBUG_PRINT
(
"my"
,(
"Fd: %d Op: %d start: %ld Length: %ld MyFlags: %d"
,
DBUG_PRINT
(
"my"
,(
"Fd: %d Op: %d start: %ld Length: %ld MyFlags: %d"
,
fd
,
locktype
,(
ulong
)
start
,(
ulong
)
length
,
MyFlags
));
fd
,
locktype
,(
ulong
)
start
,(
ulong
)
length
,
MyFlags
));
if
(
my_disable_locking
)
if
(
my_disable_locking
)
DBUG_RETURN
(
0
);
/* purecov: inspected */
DBUG_RETURN
(
0
);
/* purecov: inspected */
lock
.
l_type
=
(
short
)
locktype
;
m_
lock
.
l_type
=
(
short
)
locktype
;
lock
.
l_whence
=
0L
;
m_
lock
.
l_whence
=
0L
;
lock
.
l_start
=
(
long
)
start
;
m_
lock
.
l_start
=
(
long
)
start
;
lock
.
l_len
=
(
long
)
length
;
m_
lock
.
l_len
=
(
long
)
length
;
wait_for_alarm
=
(
MyFlags
&
MY_DONT_WAIT
?
MY_HOW_OFTEN_TO_ALARM
:
wait_for_alarm
=
(
MyFlags
&
MY_DONT_WAIT
?
MY_HOW_OFTEN_TO_ALARM
:
(
uint
)
12
*
60
*
60
);
(
uint
)
12
*
60
*
60
);
if
(
fcntl
(
fd
,
F_SETLK
,
&
lock
)
!=
-
1
)
/* Check if we can lock */
if
(
fcntl
(
fd
,
F_SETLK
,
&
m_
lock
)
!=
-
1
)
/* Check if we can lock */
DBUG_RETURN
(
0
);
/* Ok, file locked */
DBUG_RETURN
(
0
);
/* Ok, file locked */
DBUG_PRINT
(
"info"
,(
"Was locked, trying with alarm"
));
DBUG_PRINT
(
"info"
,(
"Was locked, trying with alarm"
));
if
(
!
thr_alarm
(
&
alarmed
,
wait_for_alarm
,
&
alarm_buff
))
if
(
!
thr_alarm
(
&
alarmed
,
wait_for_alarm
,
&
alarm_buff
))
{
{
int
value
;
int
value
;
while
((
value
=
fcntl
(
fd
,
F_SETLKW
,
&
lock
))
&&
!
thr_got_alarm
(
&
alarmed
)
&&
while
((
value
=
fcntl
(
fd
,
F_SETLKW
,
&
m_
lock
))
&&
!
thr_got_alarm
(
&
alarmed
)
&&
errno
==
EINTR
)
;
errno
==
EINTR
)
;
thr_end_alarm
(
&
alarmed
);
thr_end_alarm
(
&
alarmed
);
if
(
value
!=
-
1
)
if
(
value
!=
-
1
)
...
...
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