aboutsummaryrefslogtreecommitdiff
path: root/libXpm/src/WrFFrI.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-10-01 12:23:16 +0200
committermarha <marha@users.sourceforge.net>2013-10-01 12:28:08 +0200
commit6dd755aa923291db2501cc5c22e409c41a70e3c1 (patch)
treefa88a321afc13657f7687a25d466f49151c9599a /libXpm/src/WrFFrI.c
parenta5391fdea94a7b827069c6f926f83a235076ccb4 (diff)
downloadvcxsrv-6dd755aa923291db2501cc5c22e409c41a70e3c1.tar.gz
vcxsrv-6dd755aa923291db2501cc5c22e409c41a70e3c1.tar.bz2
vcxsrv-6dd755aa923291db2501cc5c22e409c41a70e3c1.zip
Update following packages:
libXpm-3.5.11 libXaw-1.0.12 libXfont-1.4.6 libXrender-0.9.8 xproto-7.0.24 inputproto-2.3 xclock-1.0.7 xhost-1.0.6
Diffstat (limited to 'libXpm/src/WrFFrI.c')
-rw-r--r--libXpm/src/WrFFrI.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/libXpm/src/WrFFrI.c b/libXpm/src/WrFFrI.c
index b592fa154..067c96b3a 100644
--- a/libXpm/src/WrFFrI.c
+++ b/libXpm/src/WrFFrI.c
@@ -45,11 +45,12 @@
#ifndef NO_ZPIPE
#include "sys/wait.h"
#include "sys/types.h"
-#include "fcntl.h"
#include "unistd.h"
#include "errno.h"
#endif
+#include "fcntl.h"
+
/* MS Windows define a function called WriteFile @#%#&!!! */
LFUNC(xpmWriteFile, int, (FILE *file, XpmImage *image, const char *name,
XpmInfo *info));
@@ -63,13 +64,13 @@ LFUNC(WritePixels, int, (FILE *file, unsigned int width, unsigned int height,
LFUNC(WriteExtensions, void, (FILE *file, XpmExtension *ext,
unsigned int num));
-LFUNC(OpenWriteFile, int, (char *filename, xpmData *mdata));
+LFUNC(OpenWriteFile, int, (const char *filename, xpmData *mdata));
LFUNC(xpmDataClose, void, (xpmData *mdata));
int
XpmWriteFileFromImage(
Display *display,
- char *filename,
+ const char *filename,
XImage *image,
XImage *shapeimage,
XpmAttributes *attributes)
@@ -99,7 +100,7 @@ XpmWriteFileFromImage(
int
XpmWriteFileFromXpmImage(
- char *filename,
+ const char *filename,
XpmImage *image,
XpmInfo *info)
{
@@ -319,7 +320,7 @@ FUNC(xpmPipeThrough, FILE*, (int fd,
*/
static int
OpenWriteFile(
- char *filename,
+ const char *filename,
xpmData *mdata)
{
if (!filename) {
@@ -346,8 +347,10 @@ OpenWriteFile(
mdata->stream.file = fdopen(fd, "w");
mdata->type = XPMFILE;
}
- if (!mdata->stream.file)
+ if (!mdata->stream.file) {
+ close(fd);
return (XpmOpenFailed);
+ }
}
return (XpmSuccess);
}