summaryrefslogtreecommitdiff
path: root/util-linux/fbset.c
diff options
context:
space:
mode:
authorMatt Kraai2000-12-22 01:48:07 +0000
committerMatt Kraai2000-12-22 01:48:07 +0000
commita9819b290848e0a760f3805d5937fa050235d707 (patch)
treeb8cb8d939032c0806d62161b01e5836cb808dc3f /util-linux/fbset.c
parente9f07fb6e83b75a50760599a5d31f494841eddf7 (diff)
downloadbusybox-a9819b290848e0a760f3805d5937fa050235d707.zip
busybox-a9819b290848e0a760f3805d5937fa050235d707.tar.gz
Use busybox error handling functions wherever possible.
Diffstat (limited to 'util-linux/fbset.c')
-rw-r--r--util-linux/fbset.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index 86f7733..40a907b 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -33,8 +33,6 @@
#include <ctype.h>
#include <sys/ioctl.h>
-#define PERROR(ctx) do { perror(ctx); exit(1); } while(0)
-
#define DEFAULTFBDEV "/dev/fb0"
#define DEFAULTFBMODE "/etc/fb.modes"
@@ -198,7 +196,7 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn,
char *p = buf;
if ((f = fopen(fn, "r")) == NULL)
- PERROR("readmode(fopen)");
+ perror_msg_and_die("readmode(fopen)");
while (!feof(f)) {
fgets(buf, sizeof(buf), f);
if ((p = strstr(buf, "mode ")) || (p = strstr(buf, "mode\t"))) {
@@ -428,9 +426,9 @@ extern int fbset_main(int argc, char **argv)
}
if ((fh = open(fbdev, O_RDONLY)) < 0)
- PERROR("fbset(open)");
+ perror_msg_and_die("fbset(open)");
if (ioctl(fh, FBIOGET_VSCREENINFO, &var))
- PERROR("fbset(ioctl)");
+ perror_msg_and_die("fbset(ioctl)");
if (g_options & OPT_READMODE) {
if (!readmode(&var, modefile, mode)) {
error_msg("Unknown video mode `%s'\n", mode);
@@ -441,7 +439,7 @@ extern int fbset_main(int argc, char **argv)
setmode(&var, &varset);
if (g_options & OPT_CHANGE)
if (ioctl(fh, FBIOPUT_VSCREENINFO, &var))
- PERROR("fbset(ioctl)");
+ perror_msg_and_die("fbset(ioctl)");
showmode(&var);
/* Don't close the file, as exiting will take care of that */
/* close(fh); */