diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2021-03-12 19:20:34 +0100 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2021-03-17 18:56:21 +0100 |
commit | 9d236fe7d27bf8d3e02db4c01bb9bb0eead49157 (patch) | |
tree | 2a885cc7a300ab6aea8633d3336da499b3bc7073 | |
parent | 7791f472f3d545b5bf0cd589f49e47a3dc1cc932 (diff) | |
download | hardware_replicant_libsamsung-ipc-9d236fe7d27bf8d3e02db4c01bb9bb0eead49157.tar.gz hardware_replicant_libsamsung-ipc-9d236fe7d27bf8d3e02db4c01bb9bb0eead49157.tar.bz2 hardware_replicant_libsamsung-ipc-9d236fe7d27bf8d3e02db4c01bb9bb0eead49157.zip |
tools: fix nv-data-md5 compilation with Replicant 6replicant-6.0-0004-rc5-transitionreplicant-6.0-0004-rc5
When compiling nv-data-md5 under Replicant 6 we have:
hardware/replicant/libsamsung-ipc/tools/nv_data-md5.c:
In function 'main':
hardware/replicant/libsamsung-ipc/tools/nv_data-md5.c:103:1:
error:
control reaches end of non-void function [-Werror=return-type]
}
^
cc1: some warnings being treated as errors
So we simply need to add a return in the error path.
While we're at it, we use an exit code referenced in sysexits.h
to follow a standard. This can help differentiating between
different types of errors.
Thanks to that, it can also simplify the code when writing tests.
As Android doesn't have sysexits.h, we also need to use the one that
has been copied inside libsamsung-ipc in tools/include/glibc, else
it would also fail to compile because of the missing header file.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r-- | Android.mk | 2 | ||||
-rw-r--r-- | tools/nv_data-md5.c | 3 |
2 files changed, 4 insertions, 1 deletions
@@ -219,7 +219,7 @@ LOCAL_MODULE_TAGS := optional LOCAL_SRC_FILES := tools/nv_data-md5.c -LOCAL_C_INCLUDES := $(LOCAL_PATH)/include +LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/tools/include/glibc LOCAL_SHARED_LIBRARIES := libsamsung-ipc diff --git a/tools/nv_data-md5.c b/tools/nv_data-md5.c index e8c9fc8..5edb257 100644 --- a/tools/nv_data-md5.c +++ b/tools/nv_data-md5.c @@ -20,6 +20,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <sysexits.h> #include <sys/types.h> @@ -100,4 +101,6 @@ int main(int argc, char *argv[]) error: if (client != NULL) ipc_client_destroy(client); + + return EX_SOFTWARE; } |