--- parser3/src/main/pa_os.C 2003/11/06 09:16:33 1.2 +++ parser3/src/main/pa_os.C 2004/07/15 06:38:10 1.7 @@ -1,11 +1,11 @@ /** @file Parser: commonly functions. - Copyright(c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com) + Copyright(c) 2001-2004 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ -const char* IDENT_COMMON_C="$Date: 2003/11/06 09:16:33 $"; +static const char * const IDENT_COMMON_C="$Date: 2004/07/15 06:38:10 $"; #include "pa_config_includes.h" #include "pa_os.h" @@ -14,11 +14,6 @@ const char* IDENT_COMMON_C="$Date: 2003/ # include # endif -// locking constants -//#define PA_DEBUG_NO_LOCKING - -#ifdef PA_DEBUG_NO_LOCKING - #ifdef HAVE_FLOCK int pa_lock_shared_blocking(int fd) { return flock(fd, LOCK_SH); } @@ -62,14 +57,6 @@ int pa_unlock(int fd) { FLOCK(F_TLOCK); #endif #endif -#else -int pa_lock_shared_blocking(int fd) { return 0; } -int pa_lock_exclusive_blocking(int fd) { return 0; } -int pa_lock_exclusive_nonblocking(int fd) { return 0; } -int pa_unlock(int fd) { return 0; } - -#endif - int pa_sleep(unsigned long secs, unsigned long usecs) { for (; usecs >= 1000000; ++secs, usecs -= 1000000); @@ -80,6 +67,6 @@ int pa_sleep(unsigned long secs, unsigne struct timeval t; t.tv_sec = secs; t.tv_usec = usecs; - return (select(0, NULL, NULL, NULL, &t) == -1 ? errno : 0); + return (select(0, NULL, NULL, NULL, &t)<0 ? errno : 0); #endif }