projects
/
profile
/
ivi
/
weston-ivi-shell.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2c76be7
)
xserver: Return EEXIST if unlinking lockfile fails
author
Kristian Høgsberg
<krh@bitplanet.net>
Tue, 10 Apr 2012 02:14:52 +0000
(22:14 -0400)
committer
Kristian Høgsberg
<krh@bitplanet.net>
Tue, 10 Apr 2012 04:04:57 +0000
(
00:04
-0400)
Otherwise we'll keep trying to unlink it.
src/xserver-launcher.c
patch
|
blob
|
history
diff --git
a/src/xserver-launcher.c
b/src/xserver-launcher.c
index
d3657c8
..
88ceb0c
100644
(file)
--- a/
src/xserver-launcher.c
+++ b/
src/xserver-launcher.c
@@
-1654,9
+1654,13
@@
create_lockfile(int display, char *lockfile, size_t lsize)
/* stale lock file; unlink and try again */
fprintf(stderr,
"unlinking stale lock file %s\n", lockfile);
- unlink(lockfile);
- errno = EAGAIN;
close(fd);
+ if (unlink(lockfile))
+ /* If we fail to unlink, return EEXIST
+ so we try the next display number.*/
+ errno = EEXIST;
+ else
+ errno = EAGAIN;
return -1;
}