svn commit: trunk/uClibc/test/misc
vapier at uclibc.org
vapier at uclibc.org
Tue Feb 14 05:12:14 UTC 2006
Author: vapier
Date: 2006-02-13 21:12:12 -0800 (Mon, 13 Feb 2006)
New Revision: 14002
Log:
get rid of link time warning with tmpname()
Modified:
trunk/uClibc/test/misc/fdopen.c
Changeset:
Modified: trunk/uClibc/test/misc/fdopen.c
===================================================================
--- trunk/uClibc/test/misc/fdopen.c 2006-02-14 05:02:38 UTC (rev 14001)
+++ trunk/uClibc/test/misc/fdopen.c 2006-02-14 05:12:12 UTC (rev 14002)
@@ -1,6 +1,7 @@
/* Test for fdopen bugs. */
#include <stdio.h>
+#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
@@ -12,17 +13,20 @@
goto the_end; \
}
-char buffer[256];
-
int
main (int argc, char *argv[])
{
- char *name;
+ char name[256];
FILE *fp = NULL;
int retval = 0;
int fd;
- name = tmpnam (NULL);
+ /* hack to get a tempfile name w/out using tmpname()
+ * as that func causes a link time warning */
+ sprintf(name, "%s-uClibc-test.XXXXXX", __FILE__);
+ fd = mkstemp(name);
+ close(fd);
+
fp = fopen (name, "w");
assert (fp != NULL)
fputs ("foobar and baz", fp);
More information about the uClibc-cvs
mailing list