libselinux: fix mac build warning when ANDROID_HOST=y

When building on Mac, outside of the Android tree, with ANDROID_HOST=y, this warning
is observed:

label.c:102:9: warning: implicit declaration of function 'fgets_unlocked' is invalid in C99 [-Wimplicit-function-declaration]
        while (fgets_unlocked(buf, sizeof(buf) - 1, cfg)) {

Fix it by using the fgets_unlocked define that was introduced for Android, just apply it for mac builds
as well.

Signed-off-by: William Roberts <william.c.roberts@intel.com>
This commit is contained in:
William Roberts 2016-10-17 16:24:05 -04:00 committed by Stephen Smalley
parent 3340d851df
commit 10199be915

View File

@ -16,8 +16,8 @@
#include "dso.h"
#include "sha1.h"
#ifdef ANDROID
// Android does not have fgets_unlocked()
#if defined(ANDROID) || defined(__APPLE__)
// Android and Mac do not have fgets_unlocked()
#define fgets_unlocked(buf, size, fp) fgets(buf, size, fp)
#endif