return -1;
}
ret = fread(buff, 1, size - 1, f);
fclose(f);
if (ret <= 0) {
return -1;
}
ret = fread(buff, 1, size - 1, f);
fclose(f);
if (ret <= 0) {
* The only way to achieve this seems to be walking some sysfs files.. */
ret = stat(fbname, &status);
if (ret != 0) {
* The only way to achieve this seems to be walking some sysfs files.. */
ret = stat(fbname, &status);
if (ret != 0) {
snprintf(buff, sizeof(buff), "/sys/class/graphics/fb%d/overlays", fb_id);
f = fopen(buff, "r");
if (f == NULL) {
snprintf(buff, sizeof(buff), "/sys/class/graphics/fb%d/overlays", fb_id);
f = fopen(buff, "r");
if (f == NULL) {
- fprintf(stderr, "can't open %s, skip screen detection\n", buff);
+ err("can't open %s, skip screen detection", buff);
- fprintf(stderr, "can't parse %s, skip screen detection\n", buff);
+ err("can't parse %s, skip screen detection", buff);
goto skip_screen;
}
snprintf(buff, sizeof(buff), "/sys/devices/platform/omapdss/overlay%d/manager", overlay_id);
ret = read_sysfs(buff, screen_name, sizeof(screen_name));
if (ret < 0) {
goto skip_screen;
}
snprintf(buff, sizeof(buff), "/sys/devices/platform/omapdss/overlay%d/manager", overlay_id);
ret = read_sysfs(buff, screen_name, sizeof(screen_name));
if (ret < 0) {
goto skip_screen;
}
snprintf(buff, sizeof(buff), "/sys/devices/platform/omapdss/display%d/timings", screen_id);
f = fopen(buff, "r");
if (f == NULL) {
goto skip_screen;
}
snprintf(buff, sizeof(buff), "/sys/devices/platform/omapdss/display%d/timings", screen_id);
f = fopen(buff, "r");
if (f == NULL) {
- fprintf(stderr, "can't open %s, skip screen detection\n", buff);
+ err("can't open %s, skip screen detection", buff);
goto skip_screen;
}
ret = fscanf(f, "%*d,%d/%*d/%*d/%*d,%d/%*d/%*d/%*d", &screen_w, &screen_h);
fclose(f);
if (ret != 2) {
goto skip_screen;
}
ret = fscanf(f, "%*d,%d/%*d/%*d/%*d,%d/%*d/%*d/%*d", &screen_w, &screen_h);
fclose(f);
if (ret != 2) {
- fprintf(stderr, "can't parse %s (%d), skip screen detection\n", buff, ret);
+ err("can't parse %s (%d), skip screen detection", buff, ret);
screen_w, screen_h, screen_name, screen_id, fb_id, overlay_id);
skip_screen:
screen_w, screen_h, screen_name, screen_id, fb_id, overlay_id);
skip_screen:
else if (sscanf(tmp, "%dx%d", &w_, &h_) == 2)
w = w_, h = h_;
else
else if (sscanf(tmp, "%dx%d", &w_, &h_) == 2)
w = w_, h = h_;
else
- fprintf(stderr, "layer size specified incorrectly, "
- "should be like 800x480");
+ err("layer size specified incorrectly, "
+ "should be like 800x480");