From 7643ace3f512cbb091db4967be27f733c82ec7ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Fri, 21 Mar 2008 01:04:18 +0000 Subject: [PATCH] [INTERPRETER] * NEW: Don't use lockf and F_TLOCK if it does not exist. A workaround will have to be found! git-svn-id: svn://localhost/gambas/trunk@1214 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- main/gbx/gbx_stream.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/main/gbx/gbx_stream.c b/main/gbx/gbx_stream.c index eac8695a0..9b4dfcb45 100644 --- a/main/gbx/gbx_stream.c +++ b/main/gbx/gbx_stream.c @@ -929,13 +929,21 @@ void STREAM_lock(STREAM *stream) if (lseek(fd, 0, SEEK_SET) < 0) goto __ERROR; - if (lockf(fd, F_TLOCK, 0)) - { - if (errno == EAGAIN) - THROW(E_LOCK); - else - goto __ERROR; - } + #ifdef F_TLOCK + + if (lockf(fd, F_TLOCK, 0)) + { + if (errno == EAGAIN) + THROW(E_LOCK); + else + goto __ERROR; + } + + #else + + fprintf(stderr, "locking is not implemented\n"); + + #endif if (lseek(fd, pos, SEEK_SET) < 0) goto __ERROR;