From 6a71208875955f1a7fe6482f518cbc3eb628d55a Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 1 Sep 1999 04:27:30 +0000 Subject: [PATCH] Use _O_TEMPORARY. Removed #ifdef, instead define the Win32-only _O_BINARY 1999-09-01 Tor Lillqvist * 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. --- ChangeLog | 9 +++++++++ app/base/tile-swap.c | 14 +++++++++----- app/makefile.cygwin | 3 +-- app/makefile.msc | 3 +-- app/tile_swap.c | 14 +++++++++----- plug-ins/common/spheredesigner.c | 5 +++++ 6 files changed, 34 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index fdaad7aec9..d1d1f6510e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +1999-09-01 Tor Lillqvist + + * 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 * plug-ins/libgck/gck/Makefile.am: use libgck_la_LIBADD to get diff --git a/app/base/tile-swap.c b/app/base/tile-swap.c index d688220caa..fa6ab92ce5 100644 --- a/app/base/tile-swap.c +++ b/app/base/tile-swap.c @@ -19,6 +19,13 @@ #include #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")); diff --git a/app/makefile.cygwin b/app/makefile.cygwin index 6f088383cf..3b22b491a2 100644 --- a/app/makefile.cygwin +++ b/app/makefile.cygwin @@ -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 \ diff --git a/app/makefile.msc b/app/makefile.msc index 9f3cc59d52..e2a78e03f9 100644 --- a/app/makefile.msc +++ b/app/makefile.msc @@ -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 \ diff --git a/app/tile_swap.c b/app/tile_swap.c index d688220caa..fa6ab92ce5 100644 --- a/app/tile_swap.c +++ b/app/tile_swap.c @@ -19,6 +19,13 @@ #include #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")); diff --git a/plug-ins/common/spheredesigner.c b/plug-ins/common/spheredesigner.c index 8b9469057f..477611f15d 100644 --- a/plug-ins/common/spheredesigner.c +++ b/plug-ins/common/spheredesigner.c @@ -15,6 +15,10 @@ * - (Probably more. ;-) */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include @@ -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