loader: unconditionally include unistd.h and stdlib.h
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Tue, 7 Feb 2017 07:43:09 +0000 (08:43 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 10 Feb 2017 11:47:12 +0000 (11:47 +0000)
commitde6e6a347dd12c079a098f3f3095394eed326166
tree2e23ea7f5f9eabdb5a2299db0aa22ccf4c605e42
parenta04cb3f8a5e53e76ffb19b55d91543d41387f372
loader: unconditionally include unistd.h and stdlib.h

Otherwise we would fail with "implicit declaration of function" geteuid
and getenv respectively.

To trigger (re)move the libdrm.pc file and use the following:

 $ ./autogen.sh --disable-egl --disable-gbm --disable-dri \
    --with-dri-drivers=swrast --with-gallium-drivers=swrast
 $ make

Cc: Vinson Lee <vlee@freedesktop.org>
Fixes: 3f462050c ("loader: Add an environment variable to override driver name choice.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99701
v2: [Emil: handle stdlib.h add commit message]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
src/loader/loader.c