On Mon, 14 May 2012 15:01:17 -0300
Luiz Capitulino <[email protected]> wrote:
> > > +
> > > + ret = execle("/sbin/shutdown", "shutdown", shutdown_flag, "+0",
> > > + "hypervisor initiated shutdown", (char*)NULL,
> > > environ);
> >
> > Where was 'environ' declared? POSIX says that environ must exist, but
> > that it is the one variable where you must declare it yourself rather
> > than getting it from a public header. (For convenience, glibc declares
> > environ in <unistd.h> when using _GNU_SOURCE, but when you are asking
> > for strict standards namespace compliance, it disappears.)
>
> I'll declare it then.
-Wredundant-decls doesn't like it:
/home/lcapitulino/work/src/qmp-unstable/qga/commands-posix.c:38:15: warning:
redundant redeclaration of ‘environ’ [-Wredundant-decls]
/usr/include/unistd.h:546:15: note: previous declaration of ‘environ’ was here
LINK qemu-ga