WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] fix minios console end of line

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] fix minios console end of line
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Tue, 13 Oct 2009 14:36:05 +0100
Delivery-date: Tue, 13 Oct 2009 06:36:16 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
Hi all,
this patch changes the end of line produced by minios' console from \n\r
to \r\n.
It applies after the other minios console fix sent as part of the
pci passthrough with stubdoms series.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

---

diff -r 18840671551b extras/mini-os/console/console.c
--- a/extras/mini-os/console/console.c  Tue Oct 13 13:15:49 2009 +0100
+++ b/extras/mini-os/console/console.c  Tue Oct 13 14:32:59 2009 +0100
@@ -79,7 +79,7 @@
 void console_print(struct consfront_dev *dev, char *data, int length)
 {
     char *curr_char, saved_char;
-    char copied_str[length];
+    char copied_str[length+1];
     char *copied_ptr;
     int part_len;
     int (*ring_send_fn)(struct consfront_dev *dev, const char *data, unsigned 
length);
@@ -95,8 +95,9 @@
     {
         if(*curr_char == '\n')
         {
+            *curr_char = '\r';
             saved_char = *(curr_char+1);
-            *(curr_char+1) = '\r';
+            *(curr_char+1) = '\n';
             part_len = curr_char - copied_ptr + 2;
             ring_send_fn(dev, copied_ptr, part_len);
             *(curr_char+1) = saved_char;
@@ -104,11 +105,14 @@
             length -= part_len - 1;
         }
     }
+
+    if (copied_ptr[length-1] == '\n') {
+        copied_ptr[length-1] = '\r';
+        copied_ptr[length] = '\n';
+        length++;
+    }
     
     ring_send_fn(dev, copied_ptr, length);
-    
-    if(copied_ptr[length-1] == '\n')
-        ring_send_fn(dev, "\r", 1);
 }
 
 void print(int direct, const char *fmt, va_list args)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] fix minios console end of line, Stefano Stabellini <=