t-base-300-v003: Change Daemon to build on Android L 32bit.
Ignore some warnings when building the Daemon.
Signed-off-by: Oana Medvesan <medvesan.oana@gmail.com>
diff --git a/MobiCoreDriverLib/Android.mk b/MobiCoreDriverLib/Android.mk
index 89696ad..3d9c506 100755
--- a/MobiCoreDriverLib/Android.mk
+++ b/MobiCoreDriverLib/Android.mk
@@ -15,6 +15,7 @@
LOCAL_SHARED_LIBRARIES += $(GLOBAL_LIBRARIES)
LOCAL_CFLAGS := -fvisibility=hidden -fvisibility-inlines-hidden
+LOCAL_CFLAGS += -Wno-missing-field-initializers
LOCAL_CFLAGS += -include buildTag.h
LOCAL_CFLAGS += -DLOG_TAG=\"McClient\"
LOCAL_CFLAGS += -DTBASE_API_LEVEL=3
@@ -56,6 +57,8 @@
LOCAL_CFLAGS += -include buildTag.h
LOCAL_CFLAGS += -DLOG_TAG=\"McDaemon\"
LOCAL_CFLAGS += -DTBASE_API_LEVEL=3
+#remove some warnings
+LOCAL_CFLAGS += -Wno-missing-field-initializers -Wno-format
LOCAL_C_INCLUDES += $(GLOBAL_INCLUDES)
LOCAL_SHARED_LIBRARIES += $(GLOBAL_LIBRARIES) libMcClient
@@ -118,4 +121,4 @@
# Import logwrapper
include $(LOG_WRAPPER)/Android.mk
-include $(BUILD_SHARED_LIBRARY)
\ No newline at end of file
+include $(BUILD_SHARED_LIBRARY)
diff --git a/MobiCoreDriverLib/Daemon/MobiCoreDriverDaemon.cpp b/MobiCoreDriverLib/Daemon/MobiCoreDriverDaemon.cpp
index f786ee8..dc7e16e 100755
--- a/MobiCoreDriverLib/Daemon/MobiCoreDriverDaemon.cpp
+++ b/MobiCoreDriverLib/Daemon/MobiCoreDriverDaemon.cpp
@@ -1374,26 +1374,13 @@
/* ignore terminal has been closed signal */
signal(SIGHUP, SIG_IGN);
-
- int i = fork();
- if (i < 0) {
- exit(1);
- }
- // Parent
- else if (i > 0) {
- exit(0);
+
+ /* become a daemon */
+ if (daemon(0, 0) < 0) {
+ fprintf(stderr, "Fork failed, exiting.\n");
+ return 1;
}
- // obtain a new process group */
- setsid();
- /* close all descriptors */
- for (i = getdtablesize(); i >= 0; --i) {
- close(i);
- }
- // STDIN, STDOUT and STDERR should all point to /dev/null */
- i = open("/dev/null", O_RDWR);
- dup(i);
- dup(i);
/* ignore tty signals */
signal(SIGTSTP, SIG_IGN);
signal(SIGTTOU, SIG_IGN);
diff --git a/MobiCoreDriverLib/buildTag.h b/MobiCoreDriverLib/buildTag.h
index 3461bd0..05cb483 100755
--- a/MobiCoreDriverLib/buildTag.h
+++ b/MobiCoreDriverLib/buildTag.h
@@ -26,4 +26,4 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define MOBICORE_COMPONENT_BUILD_TAG \
- "*** t-base-300-QC-8x26-Android-V002 ###"
+ "*** t-base-300-QC-8974-Android-V005 ###"