sync with OpenBSD -current
This commit is contained in:
parent
81739016d9
commit
48226b7c51
178 changed files with 76551 additions and 36405 deletions
|
@ -167,7 +167,6 @@ CC = @CC@
|
|||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CHANGELOG_CMD = @CHANGELOG_CMD@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CWARNFLAGS = @CWARNFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
|
|
|
@ -146,7 +146,7 @@ _XcursorPixelToColor (XcursorPixel p, XColor *color)
|
|||
static void
|
||||
_XcursorDumpImage (XImage *image)
|
||||
{
|
||||
FILE *f = fopen ("/tmp/images", "a");
|
||||
FILE *f = fopen ("/tmp/images", "a" FOPEN_CLOEXEC);
|
||||
int x, y;
|
||||
if (!f)
|
||||
return;
|
||||
|
@ -164,7 +164,7 @@ _XcursorDumpImage (XImage *image)
|
|||
static void
|
||||
_XcursorDumpColor (XColor *color, char *name)
|
||||
{
|
||||
FILE *f = fopen ("/tmp/images", "a");
|
||||
FILE *f = fopen ("/tmp/images", "a" FOPEN_CLOEXEC);
|
||||
fprintf (f, "%s: %x %x %x\n", name,
|
||||
color->red, color->green, color->blue);
|
||||
fflush (f);
|
||||
|
|
|
@ -780,10 +780,14 @@ XcursorXcFileLoad (XcursorFile *file,
|
|||
}
|
||||
images = XcursorImagesCreate (nimage);
|
||||
if (!images)
|
||||
{
|
||||
_XcursorFileHeaderDestroy (fileHeader);
|
||||
return 0;
|
||||
}
|
||||
comments = XcursorCommentsCreate (ncomment);
|
||||
if (!comments)
|
||||
{
|
||||
_XcursorFileHeaderDestroy (fileHeader);
|
||||
XcursorImagesDestroy (images);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1019,7 +1023,7 @@ XcursorFilenameLoadImage (const char *file, int size)
|
|||
if (!file || size < 0)
|
||||
return NULL;
|
||||
|
||||
f = fopen (file, "r");
|
||||
f = fopen (file, "r" FOPEN_CLOEXEC);
|
||||
if (!f)
|
||||
return NULL;
|
||||
image = XcursorFileLoadImage (f, size);
|
||||
|
@ -1036,7 +1040,7 @@ XcursorFilenameLoadImages (const char *file, int size)
|
|||
if (!file || size < 0)
|
||||
return NULL;
|
||||
|
||||
f = fopen (file, "r");
|
||||
f = fopen (file, "r" FOPEN_CLOEXEC);
|
||||
if (!f)
|
||||
return NULL;
|
||||
images = XcursorFileLoadImages (f, size);
|
||||
|
@ -1053,7 +1057,7 @@ XcursorFilenameLoadAllImages (const char *file)
|
|||
if (!file)
|
||||
return NULL;
|
||||
|
||||
f = fopen (file, "r");
|
||||
f = fopen (file, "r" FOPEN_CLOEXEC);
|
||||
if (!f)
|
||||
return NULL;
|
||||
images = XcursorFileLoadAllImages (f);
|
||||
|
@ -1072,7 +1076,7 @@ XcursorFilenameLoad (const char *file,
|
|||
if (!file)
|
||||
return XcursorFalse;
|
||||
|
||||
f = fopen (file, "r");
|
||||
f = fopen (file, "r" FOPEN_CLOEXEC);
|
||||
if (!f)
|
||||
return 0;
|
||||
ret = XcursorFileLoad (f, commentsp, imagesp);
|
||||
|
@ -1089,7 +1093,7 @@ XcursorFilenameSaveImages (const char *file, const XcursorImages *images)
|
|||
if (!file || !images)
|
||||
return XcursorFalse;
|
||||
|
||||
f = fopen (file, "w");
|
||||
f = fopen (file, "w" FOPEN_CLOEXEC);
|
||||
if (!f)
|
||||
return 0;
|
||||
ret = XcursorFileSaveImages (f, images);
|
||||
|
@ -1107,7 +1111,7 @@ XcursorFilenameSave (const char *file,
|
|||
if (!file || !comments || !images)
|
||||
return XcursorFalse;
|
||||
|
||||
f = fopen (file, "w");
|
||||
f = fopen (file, "w" FOPEN_CLOEXEC);
|
||||
if (!f)
|
||||
return 0;
|
||||
ret = XcursorFileSave (f, comments, images);
|
||||
|
|
|
@ -159,6 +159,12 @@ _XcursorNextPath (const char *path)
|
|||
return colon + 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* _XcursorThemeInherits, XcursorWhite, & XcursorSep are copied in
|
||||
* libxcb-cursor/cursor/load_cursor.c. Please update that copy to
|
||||
* include any changes made to the code for those here.
|
||||
*/
|
||||
|
||||
#define XcursorWhite(c) ((c) == ' ' || (c) == '\t' || (c) == '\n')
|
||||
#define XcursorSep(c) ((c) == ';' || (c) == ',')
|
||||
|
||||
|
@ -172,7 +178,7 @@ _XcursorThemeInherits (const char *full)
|
|||
if (!full)
|
||||
return NULL;
|
||||
|
||||
f = fopen (full, "r");
|
||||
f = fopen (full, "r" FOPEN_CLOEXEC);
|
||||
if (f)
|
||||
{
|
||||
while (fgets (line, sizeof (line), f))
|
||||
|
@ -254,7 +260,7 @@ XcursorScanTheme (const char *theme, const char *name)
|
|||
full = _XcursorBuildFullname (dir, "cursors", name);
|
||||
if (full)
|
||||
{
|
||||
f = fopen (full, "r");
|
||||
f = fopen (full, "r" FOPEN_CLOEXEC);
|
||||
free (full);
|
||||
}
|
||||
if (!f && inherits[d + 1].line == NULL)
|
||||
|
|
|
@ -36,7 +36,13 @@
|
|||
#endif
|
||||
|
||||
#include "Xcursor.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#ifdef O_CLOEXEC
|
||||
#define FOPEN_CLOEXEC "e"
|
||||
#else
|
||||
#define FOPEN_CLOEXEC ""
|
||||
#endif
|
||||
|
||||
typedef struct _XcursorFontInfo {
|
||||
struct _XcursorFontInfo *next;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue