Fixes on Debian Linux for the 'file locking'. Tested ok

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1344 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2010-02-14 01:07:05 +00:00
parent 4c3a0b6f68
commit 35121c58a8
4 changed files with 14 additions and 8 deletions

1
init.c
View File

@ -2681,3 +2681,4 @@ void Compute_menu_offsets(void)
// Update global menu coordinates
Menu_Y = Screen_height - Menu_height * Menu_factor_Y;
}

1
init.h
View File

@ -49,3 +49,4 @@ byte * Load_font(const char * font_name);
/// Based on which toolbars are visible, updates their offsets and
/// computes ::Menu_height and ::Menu_Y
void Compute_menu_offsets(void);

13
io.c
View File

@ -27,6 +27,9 @@
#include <string.h>
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#if defined(__amigaos4__)
#include <proto/dos.h>
#include <dirent.h>
@ -315,7 +318,7 @@ byte Create_lock_file(const char *file_directory)
}
#else
// Unixy method for lock file
Lock_file_handle = open(lock_filename,O_WRONLY|O_CREAT);
Lock_file_handle = open(lock_filename,O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR);
if (Lock_file_handle == -1)
{
// Usually write-protected media
@ -342,10 +345,10 @@ void Release_lock_file(const char *file_directory)
}
#else
if (Lock_file_handle != -1)
{
close(Lock_file_handle);
Lock_file_handle = -1;
}
//{
// close(Lock_file_handle);
// Lock_file_handle = -1;
//}
#endif
// Actual deletion

1
io.h
View File

@ -103,3 +103,4 @@ byte Create_lock_file(const char *file_directory);
///
/// Release a lock file created by ::Create_Lock_file
void Release_lock_file(const char *file_directory);