Browse Source

applog/quit fix GPU errors created

nfactor-troky
Kano 12 years ago
parent
commit
b5bf34dc85
  1. 2
      adl.c
  2. 31
      api.c
  3. 2
      driver-opencl.c

2
adl.c

@ -1343,7 +1343,7 @@ updated:
wlogprint("Failed to modify engine clock speed\n"); wlogprint("Failed to modify engine clock speed\n");
} else if (!strncasecmp(&input, "f", 1)) { } else if (!strncasecmp(&input, "f", 1)) {
get_fanrange(gpu, &imin, &imax); get_fanrange(gpu, &imin, &imax);
wlogprint("Enter fan percentage (%d - %d %)", imin, imax); wlogprint("Enter fan percentage (%d - %d %%)", imin, imax);
val = curses_int(""); val = curses_int("");
if (val < imin || val > imax) { if (val < imin || val > imax) {
wlogprint("Value is outside safe range, are you sure?\n"); wlogprint("Value is outside safe range, are you sure?\n");

31
api.c

@ -126,7 +126,6 @@ char *WSAErrorMsg(void) {
#endif #endif
static const char *UNAVAILABLE = " - API will not be available"; static const char *UNAVAILABLE = " - API will not be available";
static const char *INVAPIGROUPS = "Invalid --api-groups parameter";
static const char *BLANK = ""; static const char *BLANK = "";
static const char *COMMA = ","; static const char *COMMA = ",";
@ -3587,30 +3586,21 @@ static void setup_groups()
colon = strchr(ptr, ':'); colon = strchr(ptr, ':');
if (colon) if (colon)
*colon = '\0'; *colon = '\0';
applog(LOG_WARNING, "API invalid group name '%s'", ptr); quit(1, "API invalid group name '%s'", ptr);
quit(1, INVAPIGROUPS);
} }
group = GROUP(*ptr); group = GROUP(*ptr);
if (!VALIDGROUP(group)) { if (!VALIDGROUP(group))
applog(LOG_WARNING, "API invalid group name '%c'", *ptr); quit(1, "API invalid group name '%c'", *ptr);
quit(1, INVAPIGROUPS);
}
if (group == PRIVGROUP) { if (group == PRIVGROUP)
applog(LOG_WARNING, "API group name can't be '%c'", PRIVGROUP); quit(1, "API group name can't be '%c'", PRIVGROUP);
quit(1, INVAPIGROUPS);
}
if (group == NOPRIVGROUP) { if (group == NOPRIVGROUP)
applog(LOG_WARNING, "API group name can't be '%c'", NOPRIVGROUP); quit(1, "API group name can't be '%c'", NOPRIVGROUP);
quit(1, INVAPIGROUPS);
}
if (apigroups[GROUPOFFSET(group)].commands != NULL) { if (apigroups[GROUPOFFSET(group)].commands != NULL)
applog(LOG_WARNING, "API duplicate group name '%c'", *ptr); quit(1, "API duplicate group name '%c'", *ptr);
quit(1, INVAPIGROUPS);
}
ptr += 2; ptr += 2;
@ -3644,8 +3634,7 @@ static void setup_groups()
*cmd = '\0'; *cmd = '\0';
} }
} else { } else {
applog(LOG_WARNING, "API unknown command '%s' in group '%c'", ptr, group); quit(1, "API unknown command '%s' in group '%c'", ptr, group);
quit(1, INVAPIGROUPS);
} }
} }

2
driver-opencl.c

@ -685,7 +685,7 @@ retry:
if (powertune != -1) if (powertune != -1)
tailsprintf(logline, "P: %d%%", powertune); tailsprintf(logline, "P: %d%%", powertune);
tailsprintf(logline, "\n"); tailsprintf(logline, "\n");
wlog(logline); _wlog(logline);
} }
} }
#endif #endif

Loading…
Cancel
Save