mailing list of musl libc
 help / color / mirror / code / Atom feed
de1afb4a2f3d5457ea2af325e7d25c0b1892cb83 blob 617 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <time.h>
#include <stdint.h>
#include "libc.h"

char *__randname(char *);

char *__mktemp(char *template)
{
	struct timespec ts;
	size_t i, l = strlen(template);
	int retries = 10000;
	unsigned long r;

	if (l < 6 || strcmp(template+l-6, "XXXXXX")) {
		errno = EINVAL;
		*template = 0;
		return template;
	}
	while (retries--) {
		__randname(template);
		if (access(template, F_OK) < 0) return template;
	}
	*template = 0;
	errno = EEXIST;
	return template;
}

weak_alias(__mktemp, mktemp);
debug log:

solving de1afb4 ...
found de1afb4 in https://inbox.vuxu.org/musl/1359830731-24717-1-git-send-email-basile@opensource.dyc.edu/ ||
	https://inbox.vuxu.org/musl/1359349583-3643-1-git-send-email-basile@opensource.dyc.edu/
found c0e06f5 in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 c0e06f5ef424216c3b142999942b1146c801fa4d	src/temp/mktemp.c

applying [1/2] https://inbox.vuxu.org/musl/1359830731-24717-1-git-send-email-basile@opensource.dyc.edu/
diff --git a/src/temp/mktemp.c b/src/temp/mktemp.c
index c0e06f5..de1afb4 100644

Checking patch src/temp/mktemp.c...
Applied patch src/temp/mktemp.c cleanly.

skipping https://inbox.vuxu.org/musl/1359349583-3643-1-git-send-email-basile@opensource.dyc.edu/ for de1afb4
index at:
100644 de1afb4a2f3d5457ea2af325e7d25c0b1892cb83	src/temp/mktemp.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).