mirror of
https://github.com/fluencelabs/musl
synced 2025-07-06 10:02:10 +00:00
fix tempnam name generation, and a small bug in tmpnam on retry limit
This commit is contained in:
@ -26,5 +26,5 @@ char *tmpnam(char *s)
|
||||
n = ts.tv_nsec ^ (unsigned)&s ^ (unsigned)s;
|
||||
snprintf(s, L_tmpnam, "/tmp/t%x-%x", a_fetch_add(&index, 1), n);
|
||||
} while (!__syscall(SYS_access, s, F_OK) && try++<MAXTRIES);
|
||||
return try==MAXTRIES ? 0 : s;
|
||||
return try>=MAXTRIES ? 0 : s;
|
||||
}
|
||||
|
Reference in New Issue
Block a user