mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Linux doesn't allow open() with O_CREAT without permission flags anymore.
This commit is contained in:
parent
baf772785b
commit
5a09544b16
1 changed files with 12 additions and 0 deletions
|
@ -413,7 +413,11 @@ WriteOutPalette(
|
|||
strcat(filename, PALETTE_SUFFIX);
|
||||
|
||||
/* open the file for writing */
|
||||
#if defined(linux)
|
||||
if( (fd = open( filename, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR)) == -1)
|
||||
#else
|
||||
if( (fd = open( filename, O_RDWR | O_CREAT)) == -1)
|
||||
#endif
|
||||
{
|
||||
tmpStr = (char *)XtMalloc(strlen(ERR4) + strlen(filename) + 1);
|
||||
sprintf (tmpStr, ERR4, filename);
|
||||
|
@ -1087,7 +1091,11 @@ CheckFileType( void )
|
|||
strcat(tmpfile1, DT_PAL_DIR);
|
||||
strcat(tmpfile1, filename1);
|
||||
|
||||
#if defined(linux)
|
||||
if( (fd = open( tmpfile1, O_CREAT, S_IRUSR | S_IWUSR)) == -1)
|
||||
#else
|
||||
if( (fd = open( tmpfile1, O_CREAT)) == -1)
|
||||
#endif
|
||||
{
|
||||
style. longfilename = False;
|
||||
XtFree(tmpfile1);
|
||||
|
@ -1103,7 +1111,11 @@ CheckFileType( void )
|
|||
strcat(tmpfile2, DT_PAL_DIR);
|
||||
strcat(tmpfile2, filename2);
|
||||
|
||||
#if defined(linux)
|
||||
if( (fd1 = open(tmpfile2, O_CREAT | O_EXCL, S_IRUSR | S_IWUSR)) == -1)
|
||||
#else
|
||||
if( (fd1 = open(tmpfile2, O_CREAT | O_EXCL)) == -1)
|
||||
#endif
|
||||
{
|
||||
style.longfilename = False;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue