]> git.proxmox.com Git - mirror_edk2.git/commitdiff
EmulatorPkg: Make the library work with DXE Core.
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 11 Aug 2011 03:24:35 +0000 (03:24 +0000)
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 11 Aug 2011 03:24:35 +0000 (03:24 +0000)
The DXE core calls library constructors after it calls DEBUG macros, so we need more error handling in the lib.

signed-off-by: andrewfish

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12118 6f19259b-4bc3-4df7-8a09-765794883524

EmulatorPkg/Library/DxeEmuStdErrSerialPortLib/DxeEmuStdErrSerialPortLib.c

index 8d95921c035d0bd34e1677664fc5e797622ddee0..00d9f1936958bf2bba8814c8b9f822052f286cf5 100644 (file)
@@ -66,6 +66,10 @@ SerialPortWrite (
   IN UINTN     NumberOfBytes\r
   )\r
 {\r
+  if (gEmuThunk == NULL) {\r
+    return NumberOfBytes;\r
+  }\r
+  \r
   return gEmuThunk->WriteStdErr (Buffer, NumberOfBytes);\r
 }\r
 \r