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

3
init.c
View File

@ -2680,4 +2680,5 @@ 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);

15
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,14 +345,14 @@ 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
strcpy(lock_filename,file_directory);
strcat(lock_filename,"gfx2.lck");
remove(lock_filename);
}
}

3
io.h
View File

@ -102,4 +102,5 @@ 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);
void Release_lock_file(const char *file_directory);