diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-05-20 10:20:14 +0930 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-05-20 10:20:14 +0930 |
commit | 99d28c3ef37aeffe7d8ec41e45a650ba248c6958 (patch) | |
tree | f64efb86b1bc5f0c864d6a4ad0d79291f96b1c15 /xkb | |
parent | fc7e2566cc076c0d979f74871bc436df43401058 (diff) | |
parent | 0178b6a4abed0df3e90ba393709ed566105e7c2c (diff) |
Merge branch 'master' into mpx
Conflicts:
Xext/xprint.c (removed in master)
config/hal.c
dix/main.c
hw/kdrive/ati/ati_cursor.c (removed in master)
hw/kdrive/i810/i810_cursor.c (removed in master)
hw/xprint/ddxInit.c (removed in master)
xkb/ddxLoad.c
Diffstat (limited to 'xkb')
-rw-r--r-- | xkb/ddxLoad.c | 56 |
1 files changed, 33 insertions, 23 deletions
diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c index ee64c3be7..ade13c3af 100644 --- a/xkb/ddxLoad.c +++ b/xkb/ddxLoad.c @@ -274,7 +274,7 @@ char tmpname[PATH_MAX]; return True; } else - DebugF("[xkb] Error compiling keymap (%s)\n",keymap); + LogMessage(X_ERROR, "Error compiling keymap (%s)\n", keymap); #ifdef WIN32 /* remove the temporary file */ unlink(tmpname); @@ -282,9 +282,9 @@ char tmpname[PATH_MAX]; } else { #ifndef WIN32 - DebugF("[xkb] Could not invoke keymap compiler\n"); + LogMessage(X_ERROR, "XKB: Could not invoke xkbcomp\n"); #else - DebugF("[xkb] Could not open file %s\n", tmpname); + LogMessage(X_ERROR, "Could not open file %s\n", tmpname); #endif } if (nameRtrn) @@ -350,11 +350,13 @@ unsigned missing; if ((names->keycodes==NULL)&&(names->types==NULL)&& (names->compat==NULL)&&(names->symbols==NULL)&& (names->geometry==NULL)) { + LogMessage(X_ERROR, "XKB: No components provided for device %s\n", + keybd->name); return 0; } else if (!XkbDDXCompileKeymapByNames(xkb,names,want,need, nameRtrn,nameRtrnLen)){ - DebugF("[xkb] Couldn't compile keymap file\n"); + LogMessage(X_ERROR, "XKB: Couldn't compile keymap\n"); return 0; } file= XkbDDXOpenConfigFile(nameRtrn,fileName,PATH_MAX); @@ -369,8 +371,8 @@ unsigned missing; (void) unlink (fileName); return 0; } - else if (xkbDebugFlags) { - DebugF("[xkb] Loaded XKB keymap %s, defined=0x%x\n",fileName,(*xkbRtrn)->defined); + else { + DebugF("Loaded XKB keymap %s, defined=0x%x\n",fileName,(*xkbRtrn)->defined); } fclose(file); (void) unlink (fileName); @@ -390,32 +392,40 @@ XkbRF_RulesPtr rules; if (!rules_name) return False; - if (XkbBaseDirectory==NULL) { - if (strlen(rules_name)+7 > PATH_MAX) - return False; - sprintf(buf,"rules/%s",rules_name); - } - else { - if (strlen(XkbBaseDirectory)+strlen(rules_name)+8 > PATH_MAX) - return False; - sprintf(buf,"%s/rules/%s",XkbBaseDirectory,rules_name); + + if (strlen(XkbBaseDirectory) + strlen(rules_name) + 8 > PATH_MAX) { + LogMessage(X_ERROR, "XKB: Rules name is too long\n"); + return False; } - if ((file= fopen(buf,"r"))==NULL) + sprintf(buf,"%s/rules/%s", XkbBaseDirectory, rules_name); + + file = fopen(buf, "r"); + if (!file) { + LogMessage(X_ERROR, "XKB: Couldn't open rules file %s\n", buf); return False; - if ((rules= XkbRF_Create(0,0))==NULL) { + } + + rules = XkbRF_Create(0, 0); + if (!rules) { + LogMessage(X_ERROR, "XKB: Couldn't create rules struct\n"); fclose(file); return False; } - if (!XkbRF_LoadRules(file,rules)) { + + if (!XkbRF_LoadRules(file, rules)) { + LogMessage(X_ERROR, "XKB: Couldn't parse rules file %s\n", rules_name); fclose(file); XkbRF_Free(rules,True); return False; } - bzero((char *)names,sizeof(XkbComponentNamesRec)); - complete= XkbRF_GetComponents(rules,defs,names); + + memset(names, 0, sizeof(*names)); + complete = XkbRF_GetComponents(rules,defs,names); fclose(file); - XkbRF_Free(rules,True); - return complete; -} + XkbRF_Free(rules, True); + if (!complete) + LogMessage(X_ERROR, "XKB: Rules returned no components\n"); + return complete; +} |