actionScript = popen(command, "r");
- if (actionScript <= 0)
+ if (!actionScript)
return FALSE;
while (fgets(buffer, sizeof(buffer), actionScript))
actionScript = popen(command, "r");
- if (actionScript < 0)
+ if (!actionScript)
return FALSE;
while (fgets(buffer, sizeof(buffer), actionScript))
keyScript = popen(command, "r");
- if (keyScript < 0)
+ if (!keyScript)
{
free(xfc->actionScript);
xfc->actionScript = NULL;
keyScript = popen(command, "r");
- if (keyScript < 0)
+ if (!keyScript)
return -1;
while (fgets(buffer, sizeof(buffer), keyScript) != NULL)
/* We start by looking for _XKB_RULES_NAMES_BACKUP which appears to be used by libxklavier */
- xprop = popen("xprop -root _XKB_RULES_NAMES_BACKUP", "r");
+ if (!(xprop = popen("xprop -root _XKB_RULES_NAMES_BACKUP", "r")))
+ return 0;
/* Sample output for "Canadian Multilingual Standard"
*
/* Check _XKB_RULES_NAMES if _XKB_RULES_NAMES_BACKUP fails */
- xprop = popen("xprop -root _XKB_RULES_NAMES", "r");
+ if (!(xprop = popen("xprop -root _XKB_RULES_NAMES", "r")))
+ return 0;
while (fgets(buffer, sizeof(buffer), xprop) != NULL)
{
/* this tells us about the current XKB configuration, if XKB is available */
setxkbmap = popen("setxkbmap -print", "r");
+ if (!setxkbmap)
+ return NULL;
+
while (fgets(buffer, sizeof(buffer), setxkbmap) != NULL)
{
/* the line with xkb_keycodes is what interests us */