[or-cvs] r19430: {torvm} Do not close stdout when displaying messages. Start Qemu wit (torvm/trunk/build/win32/src/torvm-w32)

coderman at seul.org coderman at seul.org
Tue May 5 00:40:11 UTC 2009


Author: coderman
Date: 2009-05-04 20:40:11 -0400 (Mon, 04 May 2009)
New Revision: 19430

Modified:
   torvm/trunk/build/win32/src/torvm-w32/torvm.c
Log:
Do not close stdout when displaying messages. Start Qemu with vlan0 instead of 1 to remove harmless warning.

Modified: torvm/trunk/build/win32/src/torvm-w32/torvm.c
===================================================================
--- torvm/trunk/build/win32/src/torvm-w32/torvm.c	2009-05-05 00:27:19 UTC (rev 19429)
+++ torvm/trunk/build/win32/src/torvm-w32/torvm.c	2009-05-05 00:40:11 UTC (rev 19430)
@@ -214,10 +214,11 @@
 {
   HANDLE  hnd;
   hnd = GetStdHandle(STD_OUTPUT_HANDLE);
-  WriteFile(hnd, msg, strlen(msg), NULL, NULL);
-  msg = "\r\n";
-  WriteFile(hnd, msg, strlen(msg), NULL, NULL);
-  CloseHandle(hnd);
+  if (hnd != INVALID_HANDLE_VALUE) {
+    WriteFile(hnd, msg, strlen(msg), NULL, NULL);
+    msg = "\r\n";
+    WriteFile(hnd, msg, strlen(msg), NULL, NULL);
+  }
 }
 
 static BOOL escquote(LPTSTR  path,
@@ -1637,7 +1638,7 @@
   cmd = malloc(CMDMAX);
   if (tapname) {
     snprintf (cmd, CMDMAX -1,
-              "\"%s\" -name \"Tor VM \" -L . -no-reboot -kernel ../lib/vmlinuz -append \"%s\" -hda ../state/hdd.img -m %d -std-vga -net nic,model=pcnet,macaddr=%s -net pcap,devicename=\"%s\" -net nic,vlan=1,model=pcnet -net tap,vlan=1,ifname=\"%s\"",
+              "\"%s\" -name \"Tor VM \" -L . -no-reboot -kernel ../lib/vmlinuz -append \"%s\" -hda ../state/hdd.img -m %d -std-vga -net nic,model=pcnet,macaddr=%s -net pcap,devicename=\"%s\" -net nic,vlan=0,model=pcnet -net tap,vlan=0,ifname=\"%s\"",
 	      qemubin,
               cmdline,
               QEMU_DEF_MEM,



More information about the tor-commits mailing list