summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/files.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-25 13:23:23 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-25 13:23:23 +0000
commitbdb45bf27b86ff63c5afdff311b4065c83faf37d (patch)
treecf3a914532ecc372932b8d897e8c9abf57fbe2a4 /crawl-ref/source/files.cc
parentc500c6b3582877a10bd362722bde81eb9b94b917 (diff)
downloadcrawl-ref-bdb45bf27b86ff63c5afdff311b4065c83faf37d.tar.gz
crawl-ref-bdb45bf27b86ff63c5afdff311b4065c83faf37d.zip
Merged in crawl.akrasiac.org patches (simple messaging, milestones). These take
effect only if compiled with -DDGAMELAUNCH. Simple messaging: interacts with dgamelaunch's messaging facility allowing viewers to send messages to the player. Milestones: Writes a milestones.txt file (in xlogfile format) for things like the player killing uniques, reaching the end of a dungeon branch, etc. (similar to notes). milestones.txt is used for game announcements by an IRC bot. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1095 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/files.cc')
-rw-r--r--crawl-ref/source/files.cc14
1 files changed, 2 insertions, 12 deletions
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index 3beb2d137e..dc2b2dcbbd 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -85,12 +85,6 @@
#define DO_CHMOD_PRIVATE(x) // empty command
#endif
-// file locking stuff
-#ifdef USE_FILE_LOCKING
-static bool lock_file_handle( FILE *handle, int type );
-static bool unlock_file_handle( FILE *handle );
-#endif // USE_FILE_LOCKING
-
void save_level(int level_saved, bool was_a_labyrinth, char where_were_you);
#define GHOST_MINOR_VERSION 1
@@ -1526,7 +1520,7 @@ long readLong(FILE *file)
// first, some file locking stuff for multiuser crawl
#ifdef USE_FILE_LOCKING
-static bool lock_file_handle( FILE *handle, int type )
+bool lock_file_handle( FILE *handle, int type )
{
struct flock lock;
int status;
@@ -1537,11 +1531,8 @@ static bool lock_file_handle( FILE *handle, int type )
lock.l_type = type;
#ifdef USE_BLOCKING_LOCK
-
status = fcntl( fileno( handle ), F_SETLKW, &lock );
-
#else
-
for (int i = 0; i < 30; i++)
{
status = fcntl( fileno( handle ), F_SETLK, &lock );
@@ -1557,13 +1548,12 @@ static bool lock_file_handle( FILE *handle, int type )
perror( "Problems locking file... retrying..." );
delay( 1000 );
}
-
#endif
return (status == 0);
}
-static bool unlock_file_handle( FILE *handle )
+bool unlock_file_handle( FILE *handle )
{
struct flock lock;
int status;