Teach usermode emulation how to lie about uname -r.
[qemu] / vnc.c
diff --git a/vnc.c b/vnc.c
index 52c137d..93f61a7 100644 (file)
--- a/vnc.c
+++ b/vnc.c
@@ -1,3 +1,28 @@
+/*
+ * QEMU VNC display driver
+ * 
+ * Copyright (C) 2006 Anthony Liguori <anthony@codemonkey.ws>
+ * Copyright (C) 2006 Fabrice Bellard
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
 #include "vl.h"
 #include "qemu_socket.h"
 
@@ -406,7 +431,7 @@ static void vnc_client_error(VncState *vs)
 
 static void vnc_client_write(void *opaque)
 {
-    ssize_t ret;
+    long ret;
     VncState *vs = opaque;
 
     ret = send(vs->csock, vs->output.buffer, vs->output.offset, 0);
@@ -431,7 +456,7 @@ static void vnc_read_when(VncState *vs, VncReadEvent *func, size_t expecting)
 static void vnc_client_read(void *opaque)
 {
     VncState *vs = opaque;
-    ssize_t ret;
+    long ret;
 
     buffer_reserve(&vs->input, 4096);
 
@@ -566,7 +591,7 @@ static void pointer_event(VncState *vs, int button_mask, int x, int y)
     }
 }
 
-static void key_event(VncState *vs, int down, uint32_t sym)
+static void do_key_event(VncState *vs, int down, uint32_t sym)
 {
     int keycode;
 
@@ -580,6 +605,13 @@ static void key_event(VncState *vs, int down, uint32_t sym)
        kbd_put_keycode(keycode | 0x80);
 }
 
+static void key_event(VncState *vs, int down, uint32_t sym)
+{
+    if (sym >= 'A' && sym <= 'Z')
+       sym = sym - 'A' + 'a';
+    do_key_event(vs, down, sym);
+}
+
 static void framebuffer_update_request(VncState *vs, int incremental,
                                       int x_position, int y_position,
                                       int w, int h)