aboutsummaryrefslogtreecommitdiff
path: root/util-linux/fbset.c
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux/fbset.c')
-rw-r--r--util-linux/fbset.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index 9423abc09..afd9e64be 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -194,7 +194,7 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn,
194 char buf[256]; 194 char buf[256];
195 char *p = buf; 195 char *p = buf;
196 196
197 f = xfopen(fn, "r"); 197 f = bb_xfopen(fn, "r");
198 while (!feof(f)) { 198 while (!feof(f)) {
199 fgets(buf, sizeof(buf), f); 199 fgets(buf, sizeof(buf), f);
200 if ((p = strstr(buf, "mode ")) || (p = strstr(buf, "mode\t"))) { 200 if ((p = strstr(buf, "mode ")) || (p = strstr(buf, "mode\t"))) {
@@ -279,7 +279,7 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn,
279 } 279 }
280 } 280 }
281#else 281#else
282 error_msg( "mode reading not compiled in"); 282 bb_error_msg( "mode reading not compiled in");
283#endif 283#endif
284 return 0; 284 return 0;
285} 285}
@@ -350,7 +350,7 @@ extern int fbset_main(int argc, char **argv)
350 for (i = 0; g_cmdoptions[i].name; i++) { 350 for (i = 0; g_cmdoptions[i].name; i++) {
351 if (!strcmp(thisarg, g_cmdoptions[i].name)) { 351 if (!strcmp(thisarg, g_cmdoptions[i].name)) {
352 if (argc - 1 < g_cmdoptions[i].param_count) 352 if (argc - 1 < g_cmdoptions[i].param_count)
353 show_usage(); 353 bb_show_usage();
354 switch (g_cmdoptions[i].code) { 354 switch (g_cmdoptions[i].code) {
355 case CMD_FB: 355 case CMD_FB:
356 fbdev = argv[1]; 356 fbdev = argv[1];
@@ -399,18 +399,18 @@ extern int fbset_main(int argc, char **argv)
399 mode = *argv; 399 mode = *argv;
400 g_options |= OPT_READMODE; 400 g_options |= OPT_READMODE;
401 } else { 401 } else {
402 show_usage(); 402 bb_show_usage();
403 } 403 }
404 } 404 }
405 } 405 }
406 406
407 if ((fh = open(fbdev, O_RDONLY)) < 0) 407 if ((fh = open(fbdev, O_RDONLY)) < 0)
408 perror_msg_and_die("fbset(open)"); 408 bb_perror_msg_and_die("fbset(open)");
409 if (ioctl(fh, FBIOGET_VSCREENINFO, &var)) 409 if (ioctl(fh, FBIOGET_VSCREENINFO, &var))
410 perror_msg_and_die("fbset(ioctl)"); 410 bb_perror_msg_and_die("fbset(ioctl)");
411 if (g_options & OPT_READMODE) { 411 if (g_options & OPT_READMODE) {
412 if (!readmode(&var, modefile, mode)) { 412 if (!readmode(&var, modefile, mode)) {
413 error_msg("Unknown video mode `%s'", mode); 413 bb_error_msg("Unknown video mode `%s'", mode);
414 return EXIT_FAILURE; 414 return EXIT_FAILURE;
415 } 415 }
416 } 416 }
@@ -418,7 +418,7 @@ extern int fbset_main(int argc, char **argv)
418 setmode(&var, &varset); 418 setmode(&var, &varset);
419 if (g_options & OPT_CHANGE) 419 if (g_options & OPT_CHANGE)
420 if (ioctl(fh, FBIOPUT_VSCREENINFO, &var)) 420 if (ioctl(fh, FBIOPUT_VSCREENINFO, &var))
421 perror_msg_and_die("fbset(ioctl)"); 421 bb_perror_msg_and_die("fbset(ioctl)");
422 showmode(&var); 422 showmode(&var);
423 /* Don't close the file, as exiting will take care of that */ 423 /* Don't close the file, as exiting will take care of that */
424 /* close(fh); */ 424 /* close(fh); */