]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/LibC/Stdio/tempnam.c
StdLib: Remove an unnecessary dependency from LibWchar.
[mirror_edk2.git] / StdLib / LibC / Stdio / tempnam.c
index 368da844d095b9e7b3799d6f24cb065d350b7bfc..94d2655c8a8f031895e7c1e2f02204fec7ff97d6 100644 (file)
@@ -1,6 +1,14 @@
-/*  $NetBSD: tempnam.c,v 1.19 2005/07/27 13:23:07 drochner Exp $  */\r
+/** @file\r
+\r
+  Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials are licensed and made available under\r
+  the terms and conditions of the BSD License that accompanies this distribution.\r
+  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
-/*\r
  * Copyright (c) 1988, 1993\r
  *  The Regents of the University of California.  All rights reserved.\r
  *\r
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
  * SUCH DAMAGE.\r
- */\r
+\r
+    tempnam.c 8.1 (Berkeley) 6/4/93\r
+    NetBSD: tempnam.c,v 1.19 2005/07/27 13:23:07 drochner Exp\r
+**/\r
 #include  <LibConfig.h>\r
 #include  <sys/EfiCdefs.h>\r
-#if defined(LIBC_SCCS) && !defined(lint)\r
-#if 0\r
-static char sccsid[] = "@(#)tempnam.c 8.1 (Berkeley) 6/4/93";\r
-#else\r
-__RCSID("$NetBSD: tempnam.c,v 1.19 2005/07/27 13:23:07 drochner Exp $");\r
-#endif\r
-#endif /* LIBC_SCCS and not lint */\r
 \r
 #include  "namespace.h"\r
 #include  <sys/param.h>\r
@@ -44,7 +48,7 @@ __RCSID("$NetBSD: tempnam.c,v 1.19 2005/07/27 13:23:07 drochner Exp $");
 #include  <stdio.h>\r
 #include  <stdlib.h>\r
 #include  <string.h>\r
-#include  <sys/EfiSysCall.h>\r
+#include  <unistd.h>\r
 #include  <paths.h>\r
 #include  "reentrant.h"\r
 #include  "local.h"\r
@@ -75,7 +79,7 @@ tempnam(const char *dir, const char *pfx)
   char *name, *f;\r
   const char *tmp;\r
 \r
-  if (!(name = malloc((size_t)MAXPATHLEN)))\r
+  if ((name = malloc((size_t)MAXPATHLEN)) == NULL)\r
     return NULL;\r
 \r
   if (!pfx)\r