summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2007-08-28 15:09:03 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2007-08-28 15:09:03 -0700
commit7a0d1eb783cf541250ccd2a4618d8bb8af30178e (patch)
treea0d0c7edbeb10db54dbeebb735542f560a971d21
parent1df33901faa6a9a4bde130202c505b36e935e22a (diff)
Open /dev/fb read-only on Solaris
-rw-r--r--constype.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/constype.c b/constype.c
index 878f4ce..eaf3940 100644
--- a/constype.c
+++ b/constype.c
@@ -169,7 +169,14 @@ wu_fbid(const char* devname, char** fbname, int* fbtype)
struct vis_identifier fbid;
#endif
- if ( (fd = open(devname, O_RDWR, 0)) == -1 ) {
+
+#ifdef sun
+# define DEV_OPEN_MODE O_RDONLY
+#else
+# define DEV_OPEN_MODE O_RDWR
+#endif
+
+ if ( (fd = open(devname, DEV_OPEN_MODE, 0)) == -1 ) {
*fbname = "unable to open fb";
return 2;
}