diff options
author | Jamey Sharp <jamey@minilop.net> | 2010-05-11 10:24:00 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-05-12 12:08:38 -0700 |
commit | 21ceae9002c6364deb3d074cf2da7d3864cf6879 (patch) | |
tree | c813cbb3e14fe41f41d798caaba7c74239fdcb76 /hw/dmx/dmxfont.c | |
parent | 801162919d1c625d950a5d105ae4b3487ebc30a7 (diff) |
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: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw/dmx/dmxfont.c')
-rw-r--r-- | hw/dmx/dmxfont.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/hw/dmx/dmxfont.c b/hw/dmx/dmxfont.c index 8e4a17e50..b6b2e3111 100644 --- a/hw/dmx/dmxfont.c +++ b/hw/dmx/dmxfont.c @@ -172,7 +172,6 @@ static int dmxProcSetFontPath(ClientPtr client) unsigned long nbytes, total, n; long nfonts; int i, result; - int error; unsigned char *oldFontPath, *tmpFontPath; int nOldPaths; int lenOldPaths; @@ -198,22 +197,19 @@ static int dmxProcSetFontPath(ClientPtr client) oldFontPath = malloc(nOldPaths + lenOldPaths); memmove(oldFontPath, tmpFontPath, nOldPaths + lenOldPaths); - result = SetFontPath(client, stuff->nFonts, (unsigned char *)&stuff[1], - &error); + result = SetFontPath(client, stuff->nFonts, (unsigned char *)&stuff[1]); if (!result) { + int error = 0; for (i = 0; i < dmxNumScreens; i++) if ((result = dmxCheckFontPath(&dmxScreens[i], &error))) break; if (result) { - int ignoreresult, ignoreerror; - /* Restore old fontpath in the DMX server */ - ignoreresult = SetFontPath(client, nOldPaths, oldFontPath, - &ignoreerror); + SetFontPath(client, nOldPaths, oldFontPath); + client->errorValue = error; } else { result = client->noClientException; - client->errorValue = error; } } @@ -315,7 +311,6 @@ Bool dmxBELoadFont(ScreenPtr pScreen, FontPtr pFont) int newnpaths = 0; int len = 0; int j = 0; - int error; dmxLog(dmxError, "These font paths will not be used because the " @@ -361,8 +356,7 @@ Bool dmxBELoadFont(ScreenPtr pScreen, FontPtr pFont) } } - if (SetFontPath(serverClient, newnpaths, (unsigned char *)newfp, - &error)) { + if (SetFontPath(serverClient, newnpaths, (unsigned char *)newfp)) { /* Note that this should never happen since all of the * FPEs were previously valid. */ dmxLog(dmxError, "Cannot reset the default font path.\n"); |