summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2009-10-14 13:23:30 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2009-10-14 13:23:30 -0700
commita2c8e3e34b15b57ff881a52101fc961a602f35e4 (patch)
treef9acac961af4041663ec71c5192cfb537c24160b
parent34ddfca7b7d58240b0fe74bec6b2e0652d15c051 (diff)
Recognize XSUNBUFFERSIZE alias for XLIBBUFFERSIZE on Solaris
Also fix indenting of the XLIBBUFFERSIZE code to match surrounding code Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
-rw-r--r--src/OpenDis.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/src/OpenDis.c b/src/OpenDis.c
index 230ae561..d6c7b80d 100644
--- a/src/OpenDis.c
+++ b/src/OpenDis.c
@@ -273,21 +273,28 @@ XOpenDisplay (
#ifndef XLIBMINBUFSIZE
#define XLIBMINBUFSIZE BUFSIZE /* old default buffer size */
#endif
- if ((xlib_buffer_size = getenv("XLIBBUFFERSIZE")) == NULL)
- conn_buf_size = XLIBDEFAULTBUFSIZE;
- else
- conn_buf_size = 1024 * strtol(xlib_buffer_size, NULL, 10);
- if (conn_buf_size < XLIBMINBUFSIZE)
- conn_buf_size = XLIBMINBUFSIZE;
-
- if ((dpy->bufptr = dpy->buffer = Xcalloc(1, conn_buf_size)) == NULL) {
- OutOfMemory (dpy, setup);
- return(NULL);
- }
- dpy->bufmax = dpy->buffer + conn_buf_size;
+ xlib_buffer_size = getenv("XLIBBUFFERSIZE");
+
+#ifdef __sun /* Backwards compatibility for old Solaris libX11 name */
+ if (xlib_buffer_size == NULL)
+ xlib_buffer_size = getenv("XSUNBUFFERSIZE");
+#endif
+
+ if (xlib_buffer_size == NULL)
+ conn_buf_size = XLIBDEFAULTBUFSIZE;
+ else
+ conn_buf_size = 1024 * strtol(xlib_buffer_size, NULL, 10);
+ if (conn_buf_size < XLIBMINBUFSIZE)
+ conn_buf_size = XLIBMINBUFSIZE;
+
+ if ((dpy->bufptr = dpy->buffer = Xcalloc(1, conn_buf_size)) == NULL) {
+ OutOfMemory (dpy, setup);
+ return(NULL);
+ }
+ dpy->bufmax = dpy->buffer + conn_buf_size;
#if USE_XCB
- dpy->xcb->real_bufmax = dpy->bufmax;
- dpy->bufmax = dpy->buffer;
+ dpy->xcb->real_bufmax = dpy->bufmax;
+ dpy->bufmax = dpy->buffer;
#endif
/* Set up the input event queue and input event queue parameters. */