|
@@ -1,6 +1,7 @@
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
#include <stdio.h>
|
|
|
|
+#include <stdlib.h>
|
|
#include <unistd.h>
|
|
#include <unistd.h>
|
|
#include <fcntl.h>
|
|
#include <fcntl.h>
|
|
|
|
|
|
@@ -12,17 +13,20 @@
|
|
goto the_end; \
|
|
goto the_end; \
|
|
}
|
|
}
|
|
|
|
|
|
-char buffer[256];
|
|
|
|
-
|
|
|
|
int
|
|
int
|
|
main (int argc, char *argv[])
|
|
main (int argc, char *argv[])
|
|
{
|
|
{
|
|
- char *name;
|
|
+ char name[256];
|
|
FILE *fp = NULL;
|
|
FILE *fp = NULL;
|
|
int retval = 0;
|
|
int retval = 0;
|
|
int fd;
|
|
int fd;
|
|
|
|
|
|
- name = tmpnam (NULL);
|
|
+
|
|
|
|
+ * as that func causes a link time warning */
|
|
|
|
+ sprintf(name, "%s-uClibc-test.XXXXXX", __FILE__);
|
|
|
|
+ fd = mkstemp(name);
|
|
|
|
+ close(fd);
|
|
|
|
+
|
|
fp = fopen (name, "w");
|
|
fp = fopen (name, "w");
|
|
assert (fp != NULL)
|
|
assert (fp != NULL)
|
|
fputs ("foobar and baz", fp);
|
|
fputs ("foobar and baz", fp);
|