*/
int aul_sock_recv_reply_pkt_v2(int fd, app_pkt_t **pkt, bool do_close);
+/**
+ * This API is only for Appfw internally.
+ */
+int aul_sock_create_launchpad_client_without_timeout(const char *pad_type, uid_t uid);
+
#ifdef __cplusplus
}
#endif
return ret;
}
+extern "C" API int aul_sock_create_launchpad_client_without_timeout(
+ const char* pad_type, uid_t uid) {
+ int fd = -1;
+ try {
+ ClientSocket client;
+ std::string endpoint = "/run/aul/daemons/" + std::to_string(uid) + "/" +
+ std::string(pad_type);
+ client.Connect(endpoint);
+ fd = client.RemoveFd();
+ aul_sock_set_sock_option(fd, 0);
+ } catch (const Exception& e) {
+ _E("Exception occurs. error(%d)", e.GetErrorCode());
+ return e.GetErrorCode();
+ }
+
+ return fd;
+}
+
extern "C" API int aul_sock_create_launchpad_client(const char* pad_type,
uid_t uid) {
int fd = -1;
#include "aul.h"
#include "aul_svc.h"
+#include "aul_sock.h"
#include "launch.h"
#define LAUNCHPAD_PROCESS_POOL_SOCK ".launchpad-process-pool-sock"
static int __cmd_fast_start_run(struct launch_arg *arg)
{
+ int fd;
+
if (!access(PATH_AMD_READY, F_OK))
return __cmd_start_run(arg);
return -1;
}
- arg->pid = app_send_cmd_to_launchpad(LAUNCHPAD_PROCESS_POOL_SOCK,
- arg->uid, 0, arg->b);
+ fd = aul_sock_create_launchpad_client_without_timeout(
+ LAUNCHPAD_PROCESS_POOL_SOCK, arg->uid);
+ if (fd < 0) {
+ printf("Failed to create client socket. error: %d\n", fd);
+ return -1;
+ }
+
+ arg->pid = aul_sock_send_bundle_with_fd(fd, 0, arg->b, AUL_SOCK_NONE);
if (arg->pid <= 0) {
printf("... launch failed\n");
return -1;