Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
72dcef0e
Commit
72dcef0e
authored
Jul 31, 1997
by
Richard M. Stallman
Browse files
(current_lock_owner): Don't try to delete lock
if this or another existing process owns it!
parent
05e94d32
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
src/filelock.c
src/filelock.c
+4
-6
No files found.
src/filelock.c
View file @
72dcef0e
...
...
@@ -240,17 +240,15 @@ current_lock_owner (owner, lfname)
{
if
(
owner
->
pid
==
getpid
())
ret
=
2
;
/* We own it. */
if
(
owner
->
pid
>
0
else
if
(
owner
->
pid
>
0
&&
(
kill
(
owner
->
pid
,
0
)
>=
0
||
errno
==
EPERM
))
ret
=
1
;
/* An existing process on this machine owns it. */
/* The owner process is dead or has a strange pid (<=0), so try to
zap the lockfile. */
if
(
unlink
(
lfname
)
<
0
)
else
if
(
unlink
(
lfname
)
<
0
)
ret
=
-
1
;
ret
=
0
;
else
ret
=
0
;
}
else
{
/* If we wanted to support the check for stale locks on remote machines,
...
...
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