mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
flock fallback: remove noop path
"fail to no locking" is not an ideal strategy.
This commit is contained in:
parent
2b7dddf342
commit
3289797248
1 changed files with 1 additions and 4 deletions
|
@ -498,14 +498,12 @@ static int mk_wcswidth(const wchar_t *pwcs, size_t n) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Emulate flock() with fcntl(), where available.
|
* Emulate flock() with fcntl().
|
||||||
* Otherwise, don't do locking; just pretend success.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int flock(int fd, int op) {
|
int flock(int fd, int op) {
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
#if defined(F_SETLK) && defined(F_SETLKW)
|
|
||||||
struct flock fl = {0};
|
struct flock fl = {0};
|
||||||
|
|
||||||
switch (op & (LOCK_EX|LOCK_SH|LOCK_UN)) {
|
switch (op & (LOCK_EX|LOCK_SH|LOCK_UN)) {
|
||||||
|
@ -531,7 +529,6 @@ int flock(int fd, int op) {
|
||||||
|
|
||||||
if (rc && (errno == EAGAIN))
|
if (rc && (errno == EAGAIN))
|
||||||
errno = EWOULDBLOCK;
|
errno = EWOULDBLOCK;
|
||||||
#endif
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue