mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Add automatic TMPDIR setup/teardown to GNU Make
We now guarantee TMPDIR will be defined on a per build rule basis. It'll be an absolute path. It'll be secure and unique. It'll be rm -rf'd after the last shell script line in your build rule is executed. If $TMPDIR is already defined, then it'll be created as a subdirectory of your $TMPDIR and then replace the variable with the new definition. The Landlock Make repository will be updated with examples shortly after this change which shall be known as Landlock Make 1.1.1. See #530
This commit is contained in:
parent
e1699c5b68
commit
d36d0634db
25 changed files with 387 additions and 357 deletions
18
third_party/quickjs/quickjs-libc.c
vendored
18
third_party/quickjs/quickjs-libc.c
vendored
|
@ -615,24 +615,6 @@ static JSValue js_std_getenv(JSContext *ctx, JSValueConst this_val,
|
|||
return JS_NewString(ctx, str);
|
||||
}
|
||||
|
||||
#if defined(_WIN32)
|
||||
static void setenv(const char *name, const char *value, int overwrite)
|
||||
{
|
||||
char *str;
|
||||
size_t name_len, value_len;
|
||||
name_len = strlen(name);
|
||||
value_len = strlen(value);
|
||||
str = malloc(name_len + 1 + value_len + 1);
|
||||
memcpy(str, name, name_len);
|
||||
str[name_len] = '=';
|
||||
memcpy(str + name_len + 1, value, value_len);
|
||||
str[name_len + 1 + value_len] = '\0';
|
||||
_putenv(str);
|
||||
free(str);
|
||||
}
|
||||
|
||||
#endif /* _WIN32 */
|
||||
|
||||
static JSValue js_std_setenv(JSContext *ctx, JSValueConst this_val,
|
||||
int argc, JSValueConst *argv)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue