fix check for unsupported op on BSD

Fixes #3362
This commit is contained in:
Kurtis Rader 2016-09-08 17:35:31 -07:00
parent 87a532f533
commit af0a2add10

View File

@ -621,9 +621,10 @@ bool env_universal_t::open_and_acquire_lock(const wcstring &path, int *out_fd) {
continue;
}
#ifdef O_EXLOCK
else if (err == EOPNOTSUPP) {
else if (err == ENOTSUP || err == EOPNOTSUPP) {
// Filesystem probably does not support locking. Clear the flag and try again. Note
// that we try taking the lock via flock anyways.
// that we try taking the lock via flock anyways. Note that on Linux the two errno
// symbols have the same value but on BSD they're different.
flags &= ~O_EXLOCK;
needs_lock = true;
continue;