diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2009-12-07 13:58:42 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2009-12-07 13:58:42 -0800 |
commit | e6a6332e9fa68a80adb6f22ba77b58514d3d247f (patch) | |
tree | 0204fb3eae699dc1fa36ff2d88d4adde71885f62 | |
parent | 6c73da6848e8b54de722490e71f9e7700ad88898 (diff) |
Print more useful error messages on failures
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
-rw-r--r-- | constype.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -46,6 +46,7 @@ style. #include <stdio.h> #include <string.h> #include <unistd.h> +#include <errno.h> static int wu_fbid(const char *devname, char **fbname, int *fbtype); @@ -160,6 +161,8 @@ wu_fbid(const char* devname, char** fbname, int* fbtype) #endif if ( (fd = open(devname, DEV_OPEN_MODE, 0)) == -1 ) { + fprintf(stderr, "unable to open %s: %s\n", + devname, strerror(errno)); *fbname = "unable to open fb"; return 2; } @@ -178,6 +181,8 @@ wu_fbid(const char* devname, char** fbname, int* fbtype) ioctl_ret = ioctl(fd, FBIOGTYPE, &fbattr.fbtype); close(fd); if ( ioctl_ret == -1 ) { + fprintf(stderr, "FBIO ioctls failed on %s: %s\n", + devname, strerror(errno)); *fbname = "ioctl on fb failed"; return 2; } |