mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-22 00:38:06 +08:00
* external.cc (setup_winenv): New function.
(cygwin_internal): Implement CW_SETUP_WINENV. * sys/cygwin.h (cygwin_getinfo_types): Define CW_SETUP_WINENV.
This commit is contained in:
parent
bb6f800d18
commit
6577c186c9
@ -1,3 +1,9 @@
|
|||||||
|
2006-02-02 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
|
* external.cc (setup_winenv): New function.
|
||||||
|
(cygwin_internal): Implement CW_SETUP_WINENV.
|
||||||
|
* sys/cygwin.h (cygwin_getinfo_types): Define CW_SETUP_WINENV.
|
||||||
|
|
||||||
2006-02-02 Corinna Vinschen <corinna@vinschen.de>
|
2006-02-02 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* security.cc (is_group_member): Fix comment.
|
* security.cc (is_group_member): Fix comment.
|
||||||
|
@ -28,7 +28,9 @@ details. */
|
|||||||
#include "pwdgrp.h"
|
#include "pwdgrp.h"
|
||||||
#include "cygtls.h"
|
#include "cygtls.h"
|
||||||
#include "child_info.h"
|
#include "child_info.h"
|
||||||
|
#include "environ.h"
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
child_info *get_cygwin_startup_info ();
|
child_info *get_cygwin_startup_info ();
|
||||||
|
|
||||||
@ -133,6 +135,25 @@ check_ntsec (const char *filename)
|
|||||||
return allow_ntsec && pc.has_acls ();
|
return allow_ntsec && pc.has_acls ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Copy cygwin environment variables to the Windows environment. */
|
||||||
|
static void
|
||||||
|
setup_winenv ()
|
||||||
|
{
|
||||||
|
char **envp = __cygwin_environ;
|
||||||
|
char *var, *val;
|
||||||
|
char dummy;
|
||||||
|
|
||||||
|
while (envp && *envp)
|
||||||
|
{
|
||||||
|
var = strdup (*envp++);
|
||||||
|
val = strchr (var, '=');
|
||||||
|
*val++ = '\0';
|
||||||
|
if (!GetEnvironmentVariable (var, &dummy, 1))
|
||||||
|
SetEnvironmentVariable (var, val);
|
||||||
|
free (var);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" unsigned long
|
extern "C" unsigned long
|
||||||
cygwin_internal (cygwin_getinfo_types t, ...)
|
cygwin_internal (cygwin_getinfo_types t, ...)
|
||||||
{
|
{
|
||||||
@ -312,6 +333,9 @@ cygwin_internal (cygwin_getinfo_types t, ...)
|
|||||||
error_start_init (va_arg (arg, const char *));
|
error_start_init (va_arg (arg, const char *));
|
||||||
try_to_debug ();
|
try_to_debug ();
|
||||||
break;
|
break;
|
||||||
|
case CW_SETUP_WINENV:
|
||||||
|
setup_winenv ();
|
||||||
|
return 0;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,8 @@ typedef enum
|
|||||||
CW_HOOK,
|
CW_HOOK,
|
||||||
CW_ARGV,
|
CW_ARGV,
|
||||||
CW_ENVP,
|
CW_ENVP,
|
||||||
CW_DEBUG_SELF
|
CW_DEBUG_SELF,
|
||||||
|
CW_SETUP_WINENV
|
||||||
} cygwin_getinfo_types;
|
} cygwin_getinfo_types;
|
||||||
|
|
||||||
#define CW_NEXTPID 0x80000000 /* or with pid to get next one */
|
#define CW_NEXTPID 0x80000000 /* or with pid to get next one */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user