This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: src/newlib ChangeLog libc/posix/execvp.c libc/ ...


On Fri, Aug 25, 2000 at 07:33:25PM +0200, Corinna Vinschen wrote:
>jjohnstn@sourceware.cygnus.com wrote:
>> 
>> CVSROOT:        /cvs/src
>> Module name:    src
>> Changes by:     jjohnstn@sourceware.cygnus.com  2000-08-24 11:51:09
>> [...]
>> Log message:
>>         2000-08-23  Werner Almesberger  <Werner.Almesberger@epfl.ch>
>> 
>>         * libc/stdlib/system.c: included unistd.h for "execve" prototype,
>>         reent.h for "_fork_r" and "_wait_r" prototypes.
>>         (do_system): changed  extern char *environ[] to POSIX-friendly
>>         extern char **environ.
>
>Did anybody of you notice that this change broke building on Cygwin?
>
>unistd.h defines environ as extern char **. While the appropriate
>change was made to the unix do_system() call, nobody cared for the
>Cygwin part:

Yeah, I saw this yesterday.  I don't think that it was this change which
was responsible, though.  It looks like DJ made 'environ' == '__cygwin_environ' .
That means that environ has to be declared with 'declspec(dllimport)'.

Anyway, I've checked in a fix to system.c to rectify this.

cgf

>Index: system.c
>===================================================================
>RCS file: /cvs/src/src/newlib/libc/stdlib/system.c,v
>retrieving revision 1.2
>diff -u -p -r1.2 system.c
>--- system.c    2000/08/24 18:51:09     1.2
>+++ system.c    2000/08/25 17:32:07
>@@ -147,7 +147,7 @@ do_system (ptr, s)
> {
>   char *argv[4];
>   int pid, status;
>-  extern char *environ[];
>+  extern char **environ;
> 
>   argv[0] = "sh";
>   argv[1] = "-c";
>
>
>Corinna
>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]