Commit f743f9f7 authored by Jamey Sharp's avatar Jamey Sharp Committed by Mike Gabriel

SetFontPath: set client->errorValue on failure.

Backported from X.org: commit 21ceae9002c6364deb3d074cf2da7d3864cf6879 Author: Jamey Sharp <jamey@minilop.net> Date: Tue May 11 10:24:00 2010 -0700 SetFontPath: set client->errorValue on failure. Previously the callers were only setting errorValue on Success, when it's ignored, and leaving it alone on failure, when it's sent to the client. Since SetFontPath takes the ClientPtr, let it set client->errorValue instead of letting the callers continue to get it wrong. Signed-off-by: 's avatarJamey Sharp <jamey@minilop.net> Reviewed-by: 's avatarJulien Cristau <jcristau@debian.org> Signed-off-by: 's avatarKeith Packard <keithp@keithp.com> Backported-to-NX-by: 's avatarMike Gabriel <mike.gabriel@das-netzwerkteam.de>
parent 4768662b
...@@ -3364,7 +3364,6 @@ ProcSetFontPath(register ClientPtr client) ...@@ -3364,7 +3364,6 @@ ProcSetFontPath(register ClientPtr client)
unsigned long nbytes, total; unsigned long nbytes, total;
long nfonts; long nfonts;
int n, result; int n, result;
int error;
REQUEST(xSetFontPathReq); REQUEST(xSetFontPathReq);
REQUEST_AT_LEAST_SIZE(xSetFontPathReq); REQUEST_AT_LEAST_SIZE(xSetFontPathReq);
...@@ -3382,13 +3381,9 @@ ProcSetFontPath(register ClientPtr client) ...@@ -3382,13 +3381,9 @@ ProcSetFontPath(register ClientPtr client)
} }
if (total >= 4) if (total >= 4)
return(BadLength); return(BadLength);
result = SetFontPath(client, stuff->nFonts, (unsigned char *)&stuff[1], result = SetFontPath(client, stuff->nFonts, (unsigned char *)&stuff[1]);
&error);
if (!result) if (!result)
{
result = client->noClientException; result = client->noClientException;
client->errorValue = error;
}
return (result); return (result);
} }
......
...@@ -1805,9 +1805,8 @@ bail: ...@@ -1805,9 +1805,8 @@ bail:
return FontToXError(err); return FontToXError(err);
} }
/* XXX -- do we need to pass error down to each renderer? */
int int
SetFontPath(ClientPtr client, int npaths, unsigned char *paths, int *error) SetFontPath(ClientPtr client, int npaths, unsigned char *paths)
{ {
int err = Success; int err = Success;
...@@ -1815,7 +1814,9 @@ SetFontPath(ClientPtr client, int npaths, unsigned char *paths, int *error) ...@@ -1815,7 +1814,9 @@ SetFontPath(ClientPtr client, int npaths, unsigned char *paths, int *error)
if (SetDefaultFontPath(defaultFontPath) != Success) if (SetDefaultFontPath(defaultFontPath) != Success)
return BadValue; return BadValue;
} else { } else {
err = SetFontPathElements(npaths, paths, error, FALSE); int bad;
err = SetFontPathElements(npaths, paths, &bad, FALSE);
client->errorValue = bad;
} }
return err; return err;
} }
......
...@@ -295,7 +295,7 @@ main(int argc, char *argv[], char *envp[]) ...@@ -295,7 +295,7 @@ main(int argc, char *argv[], char *envp[])
ReserveClientIds(serverClient); ReserveClientIds(serverClient);
if (loadableFonts) { if (loadableFonts) {
SetFontPath(serverClient, 0, (unsigned char *)defaultFontPath, &error); SetFontPath(serverClient, 0, (unsigned char *)defaultFontPath);
} else { } else {
if (SetDefaultFontPath(defaultFontPath) != Success) if (SetDefaultFontPath(defaultFontPath) != Success)
ErrorF("failed to set default font path '%s'\n", ErrorF("failed to set default font path '%s'\n",
......
...@@ -100,8 +100,7 @@ extern int ImageText(ClientPtr /*client*/, ...@@ -100,8 +100,7 @@ extern int ImageText(ClientPtr /*client*/,
extern int SetFontPath(ClientPtr /*client*/, extern int SetFontPath(ClientPtr /*client*/,
int /*npaths*/, int /*npaths*/,
unsigned char * /*paths*/, unsigned char * /*paths*/);
int * /*error*/);
extern int SetDefaultFontPath(char * /*path*/); extern int SetDefaultFontPath(char * /*path*/);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment