From: Sung-jae Park Date: Thu, 22 Aug 2013 08:21:57 +0000 (+0900) Subject: Add missing files X-Git-Tag: submit/tizen_mobile/20150512.125148^2~1^2~15^2~9^2~121 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b095c19f5fbe371967b289d5daeb4edf57cc07ea;p=platform%2Fcore%2Fappfw%2Fdata-provider-slave.git Add missing files Change-Id: Ib145dd20375c45d9d904e864c07ceceb8713e9aa --- diff --git a/stub/main.c b/stub/main.c new file mode 100644 index 0000000..de270cf --- /dev/null +++ b/stub/main.c @@ -0,0 +1,54 @@ +#include +#include +#include +#include + +#include + +#include "debug.h" +#if defined(LOG_TAG) +#undef LOG_TAG +#define LOG_TAG "DATA_PROVIDER_SLAVE_LOADER" +#endif + +int errno; + +int main(int argc, char *argv[]) +{ + int i; + char **_argv; + const char *option; + + if (argc < 4) { + return -EINVAL; + } + + _argv = malloc(sizeof(char *) * (argc+2)); + if (!_argv) { + ErrPrint("%s\n", strerror(errno)); + return -ENOMEM; + } + + for (i = 1; i < argc; i++) { + _argv[i] = strdup(argv[i]); + } + _argv[i] = NULL; + + _argv[0] = strdup("/usr/apps/com.samsung.data-provider-slave/bin/data-provider-slave.loader"); + DbgPrint("Replace argv[0] with %s\n", _argv[0]); + for (i = 0; i < argc; i++) { + DbgPrint("argv[%d]: %s\n", i, _argv[i]); + } + + option = getenv("PROVIDER_HEAP_MONITOR_START"); + if (option && !strcasecmp(option, "true")) { + DbgPrint("Heap monitor is enabled\n"); + setenv("LD_PRELOAD", "/usr/lib/libheap-monitor.so", 1); + } + + execvp(_argv[0], _argv); + ErrPrint("%s\n", strerror(errno)); + return 0; +} + +/* End of a file */