]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix two warning reported in the make phase.
authorYonghong Zhu <yonghong.zhu@intel.com>
Tue, 17 Nov 2015 07:40:00 +0000 (07:40 +0000)
committeryzhu52 <yzhu52@Edk2>
Tue, 17 Nov 2015 07:40:00 +0000 (07:40 +0000)
when we make BaseTools, it report warnings about VfrError.cpp and VolInfo,
so this patch fix this warning.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18851 6f19259b-4bc3-4df7-8a09-765794883524

BaseTools/Source/C/VfrCompile/VfrError.cpp
BaseTools/Source/C/VolInfo/VolInfo.c

index 3be2bd84db141f52be91a94853af01288e274889..3c506ec2047609650d0ebf16c37ad31f8e7da730 100644 (file)
@@ -280,7 +280,7 @@ CVfrErrorHandle::HandleWarning (
   GetFileNameLineNum (LineNum, &FileName, &FileLine);\r
 \r
   if (mWarningAsError) {\r
-    Error (FileName, FileLine, 0x2220, "warning treated as error", NULL);\r
+    Error (FileName, FileLine, 0x2220, (CHAR8 *) "warning treated as error", NULL);\r
   }\r
 \r
   for (Index = 0; mVfrWarningHandleTable[Index].mWarningCode != VFR_WARNING_CODEUNDEFINED; Index++) {\r
index 7e79d753676bc918869709b5ab7405358f299337..87e78d48a872ebbefe090967c822c10e5718637d 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 The tool dumps the contents of a firmware volume\r
 \r
-Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -17,6 +17,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <string.h>\r
 #include <ctype.h>\r
 #include <assert.h>\r
+#ifdef __GNUC__\r
+#include <unistd.h>\r
+#endif\r
 \r
 #include <FvLib.h>\r
 #include <Common/UefiBaseTypes.h>\r
@@ -1422,9 +1425,21 @@ Returns:
           );\r
 \r
       if (ExtractionTool != NULL) {\r
-\r
+       #ifndef __GNUC__\r
         ToolInputFile = CloneString (tmpnam (NULL));\r
         ToolOutputFile = CloneString (tmpnam (NULL));\r
+       #else\r
+        char tmp1[] = "/tmp/fileXXXXXX";\r
+        char tmp2[] = "/tmp/fileXXXXXX";\r
+        int fd1;\r
+        int fd2;\r
+        fd1 = mkstemp(tmp1);\r
+        fd2 = mkstemp(tmp2);\r
+        ToolInputFile = CloneString(tmp1);\r
+        ToolOutputFile = CloneString(tmp2);\r
+        close(fd1);\r
+        close(fd2);\r
+       #endif\r
 \r
         //\r
         // Construction 'system' command string\r