Use _O_TEMPORARY. Removed #ifdef, instead define the Win32-only _O_BINARY

1999-09-01  Tor Lillqvist  <tml@iki.fi>

* app/tile_swap.c (tile_swap_open): Use _O_TEMPORARY. Removed
#ifdef, instead define the Win32-only _O_BINARY and _O_TEMPORARY
as zero if not defined.

* plug-ins/common/spheredesigner.c: Include config.h (#if
HAVE_CONFIG_H). RAND_FUNC and SRAND_FUNC are defined in that.
This commit is contained in:
Tor Lillqvist
1999-09-01 04:27:30 +00:00
committed by Tor Lillqvist
parent 10e8cc5761
commit 6a71208875
6 changed files with 34 additions and 14 deletions

View File

@ -1,3 +1,12 @@
1999-09-01 Tor Lillqvist <tml@iki.fi>
* app/tile_swap.c (tile_swap_open): Use _O_TEMPORARY. Removed
#ifdef, instead define the Win32-only _O_BINARY and _O_TEMPORARY
as zero if not defined.
* plug-ins/common/spheredesigner.c: Include config.h (#if
HAVE_CONFIG_H). RAND_FUNC and SRAND_FUNC are defined in that.
Tue Aug 31 20:21:34 PDT 1999 Manish Singh <yosh@gimp.org>
* plug-ins/libgck/gck/Makefile.am: use libgck_la_LIBADD to get

View File

@ -19,6 +19,13 @@
#include <io.h>
#endif
#ifndef _O_BINARY
#define _O_BINARY 0
#endif
#ifndef _O_TEMPORARY
#define _O_TEMPORARY 0
#endif
#include "libgimp/gimpintl.h"
#define MAX_OPEN_SWAP_FILES 16
@ -371,11 +378,8 @@ tile_swap_open (SwapFile *swap_file)
nopen_swap_files -= 1;
}
#ifndef NATIVE_WIN32
swap_file->fd = open (swap_file->filename, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR);
#else
swap_file->fd = open (swap_file->filename, O_CREAT|O_RDWR|_O_BINARY, _S_IREAD|_S_IWRITE);
#endif
swap_file->fd = open (swap_file->filename, O_CREAT|O_RDWR|_O_BINARY|_O_TEMPORARY, _S_IREAD|_S_IWRITE);
if (swap_file->fd == -1)
{
g_message (_("unable to open swap file...BAD THINGS WILL HAPPEN SOON"));

View File

@ -137,14 +137,13 @@ gimp_OBJECTS = \
gimpbrushgenerated.o \
gimpbrushlist.o \
gimpbrushpipe.o \
gimpbrushpreview.o \
gimpcontext.o \
gimpcontextpreview.o \
gimpdnd.o \
gimphistogram.o \
gimplist.o \
gimplut.o \
gimpparasite.o \
gimppatternpreview.o \
gimpprogress.o \
gimprc.o \
gimprc_cmds.o \

View File

@ -144,14 +144,13 @@ gimp_OBJECTS = \
gimpbrushgenerated.obj \
gimpbrushlist.obj \
gimpbrushpipe.obj \
gimpbrushpreview.obj \
gimpcontext.obj \
gimpcontextpreview.obj \
gimpdnd.obj \
gimphistogram.obj \
gimplist.obj \
gimplut.obj \
gimpparasite.obj \
gimppatternpreview.obj \
gimpprogress.obj \
gimprc.obj \
gimprc_cmds.obj \

View File

@ -19,6 +19,13 @@
#include <io.h>
#endif
#ifndef _O_BINARY
#define _O_BINARY 0
#endif
#ifndef _O_TEMPORARY
#define _O_TEMPORARY 0
#endif
#include "libgimp/gimpintl.h"
#define MAX_OPEN_SWAP_FILES 16
@ -371,11 +378,8 @@ tile_swap_open (SwapFile *swap_file)
nopen_swap_files -= 1;
}
#ifndef NATIVE_WIN32
swap_file->fd = open (swap_file->filename, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR);
#else
swap_file->fd = open (swap_file->filename, O_CREAT|O_RDWR|_O_BINARY, _S_IREAD|_S_IWRITE);
#endif
swap_file->fd = open (swap_file->filename, O_CREAT|O_RDWR|_O_BINARY|_O_TEMPORARY, _S_IREAD|_S_IWRITE);
if (swap_file->fd == -1)
{
g_message (_("unable to open swap file...BAD THINGS WILL HAPPEN SOON"));

View File

@ -15,6 +15,10 @@
* - (Probably more. ;-)
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <string.h>
#include <gtk/gtk.h>
@ -33,6 +37,7 @@
#endif
/* Tor Lillqvist used these, but they're not defined on my system? -Vidar */
/* They are in GIMP's config.h. --tml */
#ifndef SRAND_FUNC
#define SRAND_FUNC srand
#endif