Reimplemented mem pool to support multiple leases for a single identity
[strongswan.git] / src / charon / charon.c
index 826fab8..84cd546 100644 (file)
 #include <utils/backtrace.h>
 #include <threading/thread.h>
 
+#ifdef ANDROID
+#include <private/android_filesystem_config.h>
+#endif
+
+
 /**
  * PID file, in which charon stores its process id
  */
@@ -183,6 +188,9 @@ static bool lookup_uid_gid()
                charon->gid = grp->gr_gid;
        }
 #endif
+#ifdef ANDROID
+       charon->uid = AID_VPN;
+#endif
        return TRUE;
 }
 
@@ -254,7 +262,7 @@ static void unlink_pidfile()
         * permissions on the parent dir(s) of the PID file */
        if (pidfile)
        {
-               ftruncate(fileno(pidfile), 0);
+               ignore_result(ftruncate(fileno(pidfile), 0));
                fclose(pidfile);
        }
        unlink(PID_FILE);