From: shingil.kang Date: Mon, 18 Apr 2016 09:17:05 +0000 (+0900) Subject: Fixed build warnings. X-Git-Tag: accepted/tizen/common/20160425.144951^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2f4a9d9c1670bbe26286b8cf69169cbb7041e9db;p=sdk%2Ftarget%2Fsdbd.git Fixed build warnings. Change-Id: I1063d7ae01b6b28699cd90d82f9fe88c1737a34a Signed-off-by: shingil.kang --- diff --git a/packaging/sdbd.spec b/packaging/sdbd.spec index 0a7d9aa..a05aff7 100644 --- a/packaging/sdbd.spec +++ b/packaging/sdbd.spec @@ -2,7 +2,7 @@ Name: sdbd Summary: SDB daemon -Version: 3.0.9 +Version: 3.0.10 Release: 0 License: Apache-2.0 Summary: SDB daemon diff --git a/src/file_sync_service.c b/src/file_sync_service.c index 0e97ab4..d142ff1 100644 --- a/src/file_sync_service.c +++ b/src/file_sync_service.c @@ -39,13 +39,10 @@ #define SYNC_TIMEOUT 15 -#define APP_INSTALL_PATH_PREFIX1 tzplatform_getenv(TZ_SYS_RW_APP) -#define APP_INSTALL_PATH_PREFIX2 tzplatform_mkpath(TZ_SDK_HOME, "apps_rw") - struct sync_permit_rule { const char *name; - const char *regx; + char *regx; int mode; // 0:push, 1: pull, 2: push&push }; @@ -63,9 +60,19 @@ struct sync_permit_rule sdk_sync_permit_rule[] = { void init_sdk_sync_permit_rule_regx(void) { - asprintf(&sdk_sync_permit_rule[0].regx, "^((/tmp)|(%s)|(%s))/[a-zA-Z0-9]{10}/data/[a-zA-Z0-9_\\-]{1,50}\\.xml$", APP_INSTALL_PATH_PREFIX1, APP_INSTALL_PATH_PREFIX2); - asprintf(&sdk_sync_permit_rule[1].regx, "^((/tmp)|(%s)|(%s))/[a-zA-Z0-9]{10}/data/+(.)*\\.gcda$", APP_INSTALL_PATH_PREFIX1, APP_INSTALL_PATH_PREFIX2); - asprintf(&sdk_sync_permit_rule[2].regx, "^(/tmp/da/)*+[a-zA-Z0-9_\\-\\.]{1,50}\\.png$"); + int ret; + ret = asprintf(&sdk_sync_permit_rule[0].regx, "^((/tmp)|(%s)|(%s))/[a-zA-Z0-9]{10}/data/[a-zA-Z0-9_\\-]{1,50}\\.xml$", APP_INSTALL_PATH_PREFIX1, APP_INSTALL_PATH_PREFIX2); + if(ret < 0) { + D("failed to run asprintf for unittest\n"); + } + ret = asprintf(&sdk_sync_permit_rule[1].regx, "^((/tmp)|(%s)|(%s))/[a-zA-Z0-9]{10}/data/+(.)*\\.gcda$", APP_INSTALL_PATH_PREFIX1, APP_INSTALL_PATH_PREFIX2); + if (ret < 0) { + D("failed to run asprintf for codecoverage\n"); + } + ret = asprintf(&sdk_sync_permit_rule[2].regx, "^(/tmp/da/)*+[a-zA-Z0-9_\\-\\.]{1,50}\\.png$"); + if (ret < 0) { + D("failed to run asprintf for da\n"); + } } static void set_syncfile_smack_label(char *src) { @@ -285,11 +292,12 @@ static int fail_message(int s, const char *reason) static int fail_errno(int s) { - char buf[512]; + char* ret_str; + char buf[512]; - strerror_r(s, buf, sizeof(buf)); + ret_str = strerror_r(s, buf, sizeof(buf)); - return fail_message(s, buf); + return fail_message(s, (const char*)ret_str); } // FIXME: should get the following paths with api later but, do it for simple and not having dependency on other packages @@ -310,16 +318,16 @@ static void sync_mediadb(char *path) { } if (strstr(path, MEDIA_CONTENTS_PATH1) != NULL) { - char *arg_list[] = {CMD_MEDIADB_UPDATE, "-r", MEDIA_CONTENTS_PATH1, NULL}; - spawn(CMD_MEDIADB_UPDATE, arg_list); + const char * const arg_list[] = {CMD_MEDIADB_UPDATE, "-r", MEDIA_CONTENTS_PATH1, NULL}; + spawn(CMD_MEDIADB_UPDATE, (char * const*)arg_list); D("media db update done to %s\n", MEDIA_CONTENTS_PATH1); } else if (strstr(path, MEDIA_CONTENTS_PATH2) != NULL) { - char *arg_list[] = {CMD_MEDIADB_UPDATE, "-r", MEDIA_CONTENTS_PATH2, NULL}; - spawn(CMD_MEDIADB_UPDATE, arg_list); + const char * const arg_list[] = {CMD_MEDIADB_UPDATE, "-r", MEDIA_CONTENTS_PATH2, NULL}; + spawn(CMD_MEDIADB_UPDATE, (char * const*)arg_list); D("media db update done to %s\n", MEDIA_CONTENTS_PATH2); } else if (strstr(path, MEDIA_CONTENTS_PATH3) != NULL) { - char *arg_list[] = {CMD_MEDIADB_UPDATE, "-r", MEDIA_CONTENTS_PATH3, NULL}; - spawn(CMD_MEDIADB_UPDATE, arg_list); + const char * const arg_list[] = {CMD_MEDIADB_UPDATE, "-r", MEDIA_CONTENTS_PATH3, NULL}; + spawn(CMD_MEDIADB_UPDATE, (char * const*)arg_list); D("media db update done to %s\n", MEDIA_CONTENTS_PATH3); } return; @@ -475,7 +483,10 @@ static int do_send(int s, int noti_fd, char *path, char *buffer) { char *tmp; mode_t mode; - int is_link, ret; + int ret; +#ifdef HAVE_SYMLINKS + int is_link; +#endif // Check the capability for file push support. if(!is_support_push()) { @@ -488,9 +499,7 @@ static int do_send(int s, int noti_fd, char *path, char *buffer) *tmp = 0; errno = 0; mode = strtoul(tmp + 1, NULL, 0); -#ifndef HAVE_SYMLINKS - is_link = 0; -#else +#ifdef HAVE_SYMLINKS is_link = S_ISLNK(mode); #endif // extracts file permission from stat.mode. (ex 100644 & 0777 = 644); @@ -499,11 +508,15 @@ static int do_send(int s, int noti_fd, char *path, char *buffer) } if(!tmp || errno) { mode = 0644; // set default permission value in most of unix system. +#ifdef HAVE_SYMLINKS is_link = 0; +#endif } if (is_pkg_file_path(path)) { mode = 0644; +#ifdef HAVE_SYMLINKS is_link = 0; +#endif } // sdb does not allow to check that file exists or not. After deleting old file and creating new file again unconditionally. @@ -601,7 +614,7 @@ static int verify_sync_rule(const char* path) { } } regfree(®ex); - for (i = 0; i <= 3; i++){ + for (i=0; sdk_sync_permit_rule[i].regx != NULL; i++){ free(sdk_sync_permit_rule[i].regx); } return 0; diff --git a/src/sdb.c b/src/sdb.c index ac5f2ad..61b5bc4 100644 --- a/src/sdb.c +++ b/src/sdb.c @@ -92,7 +92,7 @@ static int is_support_sockproto(); void (*usb_init)() = NULL; void (*usb_cleanup)() = NULL; int (*usb_write)(usb_handle *h, const void *data, int len) = NULL; -int (*usb_read)(usb_handle *h, void *data, int len) = NULL; +int (*usb_read)(usb_handle *h, void *data, size_t len) = NULL; int (*usb_close)(usb_handle *h) = NULL; void (*usb_kick)(usb_handle *h) = NULL; @@ -128,7 +128,7 @@ void handle_sig_term(int sig) { if (access(SDB_PIDPATH, F_OK) == 0) sdb_unlink(SDB_PIDPATH); #endif - char *cmd1_args[] = {"/usr/bin/killall", "/usr/bin/debug_launchpad_preloading_preinitializing_daemon", NULL}; + char * const cmd1_args[] = {"/usr/bin/killall", "/usr/bin/debug_launchpad_preloading_preinitializing_daemon", NULL}; spawn("/usr/bin/killall", cmd1_args); sdb_sleep_ms(1000); } @@ -1361,14 +1361,17 @@ static void *bootdone_cb(void *x) { char rule[MAX_LOCAL_BUFSZ]; GMainLoop *mainloop; +/* g_type_init() is deprecated for glib version 2.35.0 or greater, */ +#if !GLIB_CHECK_VERSION(2,35,0) g_type_init(); +#endif dbus_error_init(&error); bus = dbus_bus_get(DBUS_BUS_SYSTEM, &error); if (!bus) { D("Failed to connect to the D-BUS daemon: %s", error.message); dbus_error_free(&error); - return -1; + return NULL; } dbus_connection_setup_with_g_main(bus, NULL); @@ -1379,12 +1382,12 @@ static void *bootdone_cb(void *x) { if (dbus_error_is_set(&error)) { D("Fail to rule set: %s", error.message); dbus_error_free(&error); - return -1; + return NULL; } if (dbus_connection_add_filter(bus, __sdbd_dbus_signal_filter, NULL, NULL) == FALSE) - return -1; + return NULL; D("booting signal initialized\n"); mainloop = g_main_loop_new(NULL, FALSE); @@ -1392,7 +1395,7 @@ static void *bootdone_cb(void *x) { D("dbus loop exited"); - return 0; + return NULL; } void register_bootdone_cb() { @@ -1499,7 +1502,7 @@ int set_sdk_user_privileges() { } static void execute_required_process() { - char *cmd_args[] = {"/usr/bin/debug_launchpad_preloading_preinitializing_daemon",NULL}; + char * const cmd_args[] = {"/usr/bin/debug_launchpad_preloading_preinitializing_daemon",NULL}; spawn("/usr/bin/debug_launchpad_preloading_preinitializing_daemon", cmd_args); } diff --git a/src/sdb.h b/src/sdb.h index 21056b6..dd0fe23 100644 --- a/src/sdb.h +++ b/src/sdb.h @@ -521,7 +521,7 @@ int local_connect_arbitrary_ports(int console_port, int sdb_port, const char *d void usb_init(); void usb_cleanup(); int usb_write(usb_handle *h, const void *data, int len); -int usb_read(usb_handle *h, void *data, int len); +int usb_read(usb_handle *h, void *data, size_t len); int usb_close(usb_handle *h); void usb_kick(usb_handle *h); #else @@ -529,7 +529,7 @@ void usb_kick(usb_handle *h); extern void (*usb_init)(); extern void (*usb_cleanup)(); extern int (*usb_write)(usb_handle *h, const void *data, int len); -extern int (*usb_read)(usb_handle *h, void *data, int len); +extern int (*usb_read)(usb_handle *h, void *data, size_t len); extern int (*usb_close)(usb_handle *h); extern void (*usb_kick)(usb_handle *h); @@ -537,7 +537,7 @@ extern void (*usb_kick)(usb_handle *h); void ffs_usb_init(); void ffs_usb_cleanup(); int ffs_usb_write(usb_handle *h, const void *data, int len); -int ffs_usb_read(usb_handle *h, void *data, int len); +int ffs_usb_read(usb_handle *h, void *data, size_t len); int ffs_usb_close(usb_handle *h); void ffs_usb_kick(usb_handle *h); @@ -545,7 +545,7 @@ void ffs_usb_kick(usb_handle *h); void linux_usb_init(); void linux_usb_cleanup(); int linux_usb_write(usb_handle *h, const void *data, int len); -int linux_usb_read(usb_handle *h, void *data, unsigned len); +int linux_usb_read(usb_handle *h, void *data, size_t len); int linux_usb_close(usb_handle *h); void linux_usb_kick(usb_handle *h); diff --git a/src/sdktools.c b/src/sdktools.c index f24bccc..7780101 100644 --- a/src/sdktools.c +++ b/src/sdktools.c @@ -32,10 +32,10 @@ struct sudo_command root_commands[] = { } }, /* end */ - { NULL, NULL, NULL } + { NULL, NULL, {NULL} } }; -static struct command_suffix +struct command_suffix { const char *name; // comments for human const char *suffix; //pattern diff --git a/src/sdktools.h b/src/sdktools.h index 50b68de..9027970 100644 --- a/src/sdktools.h +++ b/src/sdktools.h @@ -26,7 +26,7 @@ struct arg_permit_rule #define SDK_LAUNCH_PATH "/usr/sbin/sdk_launch" #define APP_INSTALL_PATH_PREFIX1 tzplatform_getenv(TZ_SYS_RW_APP) -#define APP_INSTALL_PATH_PREFIX2 tzplatform_getenv(TZ_USER_APP) +#define APP_INSTALL_PATH_PREFIX2 tzplatform_mkpath(TZ_SDK_HOME, "apps_rw") #define DEV_INSTALL_PATH_PREFIX tzplatform_getenv(TZ_SDK_TOOLS) #define GDBSERVER_PATH tzplatform_mkpath(TZ_SDK_TOOLS,"gdbserver/gdbserver") #define GDBSERVER_PLATFORM_PATH tzplatform_mkpath(TZ_SDK_TOOLS,"gdbserver-platform/gdbserver") diff --git a/src/services.c b/src/services.c index 9607462..dc19c14 100644 --- a/src/services.c +++ b/src/services.c @@ -387,7 +387,7 @@ static int create_service_thread(void (*func)(int, void *), void *cookie) #if !SDB_HOST -static void redirect_and_exec(int pts, const char *cmd, const char *argv[], const char *envp[]) +static void redirect_and_exec(int pts, const char *cmd, char * const argv[], char * const envp[]) { dup2(pts, 0); dup2(pts, 1); @@ -398,7 +398,7 @@ static void redirect_and_exec(int pts, const char *cmd, const char *argv[], cons execve(cmd, argv, envp); } -static int create_subprocess(const char *cmd, pid_t *pid, const char *argv[], const char *envp[]) +static int create_subprocess(const char *cmd, pid_t *pid, char * const argv[], char * const envp[]) { char devname[64]; int ptm; @@ -517,7 +517,6 @@ static void get_env(char *key, char **env) { FILE *fp; char buf[1024]; - int i; char *s, *e, *value; fp = fopen (LOGIN_CONFIG, "r"); @@ -641,7 +640,7 @@ static int create_subproc_thread(const char *name, int lines, int columns) }; args[2] = new_cmd; - ret_fd = create_subprocess(SHELL_COMMAND, &pid, args, envp); + ret_fd = create_subprocess(SHELL_COMMAND, &pid, (char * const*)args, (char * const*)envp); free(new_cmd); } else { // in case of shell interactively // Check the capability for interactive shell support. @@ -650,12 +649,12 @@ static int create_subproc_thread(const char *name, int lines, int columns) return -1; } - char *args[] = { + char * const args[] = { SHELL_COMMAND, "-", NULL, }; - ret_fd = create_subprocess(SHELL_COMMAND, &pid, args, envp); + ret_fd = create_subprocess(SHELL_COMMAND, &pid, (char * const*)args, (char * const*)envp); #if 0 // FIXME: should call login command instead of /bin/sh if (should_drop_privileges()) { char *args[] = { @@ -950,7 +949,6 @@ static void sync_windowsize(int fd, void *cookie) { const unsigned COMMAND_TIMEOUT = 10000; void get_boot(int fd, void *cookie) { char buf[2] = { 0, }; - char *mode = (char*) cookie; int time = 0; int interval = 1000; while (time < COMMAND_TIMEOUT) { @@ -1076,7 +1074,7 @@ int service_to_fd(const char *name) } } else if(!strncmp(name, "shellconf:", 10)){ if(!strncmp(name+10, "syncwinsz:", 10)){ - ret = create_service_thread(sync_windowsize, name+20); + ret = create_service_thread(sync_windowsize, (void *)name+20); } } diff --git a/src/transport.c b/src/transport.c index c4b64d7..a697eee 100644 --- a/src/transport.c +++ b/src/transport.c @@ -524,7 +524,7 @@ static int transport_read_action(int fd, struct tmsg* m) { char *p = (char*)m; - int len = sizeof(*m); + size_t len = sizeof(*m); int r; while(len > 0) { @@ -546,7 +546,7 @@ static int transport_write_action(int fd, struct tmsg* m) { char *p = (char*)m; - int len = sizeof(*m); + size_t len = sizeof(*m); int r; while(len > 0) { @@ -745,7 +745,6 @@ atransport *acquire_one_transport(int state, transport_type ttype, const char* s { atransport *t; atransport *result = NULL; - int ambiguous = 0; if (error_out) *error_out = "device not found"; @@ -769,7 +768,6 @@ atransport *acquire_one_transport(int state, transport_type ttype, const char* s if (result) { if (error_out) *error_out = "more than one device"; - ambiguous = 1; result = NULL; break; } @@ -778,7 +776,6 @@ atransport *acquire_one_transport(int state, transport_type ttype, const char* s if (result) { if (error_out) *error_out = "more than one emulator"; - ambiguous = 1; result = NULL; break; } @@ -787,7 +784,6 @@ atransport *acquire_one_transport(int state, transport_type ttype, const char* s if (result) { if (error_out) *error_out = "more than one device and emulator"; - ambiguous = 1; result = NULL; break; } @@ -1058,9 +1054,9 @@ int readx(int fd, void *ptr, size_t len) char *p = ptr; int r; #if SDB_TRACE - int len0 = len; + size_t len0 = len; #endif - D("readx: fd=%d wanted=%d\n", fd, (int)len); + D("readx: fd=%d wanted=%d\n", fd, len); while(len > 0) { r = sdb_read(fd, p, len); if(r > 0) { @@ -1091,7 +1087,7 @@ int writex(int fd, const void *ptr, size_t len) int r; #if SDB_TRACE - D("writex: fd=%d len=%d: ", fd, (int)len); + D("writex: fd=%d len=%d: ", fd, len); dump_hex( ptr, len ); #endif while(len > 0) { diff --git a/src/transport_local.c b/src/transport_local.c index 1daa143..527e1f5 100644 --- a/src/transport_local.c +++ b/src/transport_local.c @@ -415,85 +415,6 @@ static const char _ok_resp[] = "ok"; #endif // !SDB_HOST #endif -/*! - * static int send_msg_to_host_from_guest(const char *hostname, int host_port, char *request, int sock_type) - * @brief Sends \c request to host using specified protocol - * - * @param hostname Hostname -- could be domain name or IP - * @param host_port Host port - * @param request Message to be sent to host - * @param protocol IP protocol to be used: IPPROTO_TCP or IPPROTO_UDP - * - * @returns 0 on success, -1 otherwise - * - * @note SOCK_STREAM will be used for IPPROTO_TCP as socket type - * and SOCK_DGRAM for IPPROTO_UDP - */ -static int send_msg_to_host_from_guest(const char *hostname, int host_port, char *request, int protocol) { - int sock = -1; - int PORT_SIZE = 32; - char port[PORT_SIZE]; /* string decimal representation for getaddrinfo */ - struct addrinfo hints = {0}; - struct addrinfo *addresses, *curr_addr; - int getaddr_ret; - const char *protocol_name = "unknown"; /* for debug message */ - - switch(protocol) { - case IPPROTO_TCP: - protocol_name = "tcp"; - hints.ai_socktype = SOCK_STREAM; - break; - case IPPROTO_UDP: - protocol_name = "udp"; - hints.ai_socktype = SOCK_DGRAM; - break; - default: - D("unsupported protocol: %d", protocol); - return -1; - } - - D("try to send notification to host(%s:%d) using %s:[%s]\n", hostname, host_port, protocol_name, request); - - hints.ai_family = AF_INET; - - snprintf(port, PORT_SIZE, "%d", host_port); - getaddr_ret = getaddrinfo(hostname, port, &hints, &addresses); - - if (getaddr_ret != 0) { - D("could not resolve %s\n", hostname); - return -1; - } - - for(curr_addr = addresses; curr_addr != NULL; curr_addr = curr_addr->ai_next) { - sock = socket(curr_addr->ai_family, curr_addr->ai_socktype, curr_addr->ai_protocol); - if (sock == -1) - continue; - - if (connect(sock, curr_addr->ai_addr, curr_addr->ai_addrlen) != -1) - break; /* Success */ - - sdb_close(sock); - } - - if(curr_addr == NULL) { /* No address succeeded */ - freeaddrinfo(addresses); - D("could not connect to server\n"); - return -1; - } - - freeaddrinfo(addresses); - - if (sdb_write(sock, request, strlen(request)) < 0) { - D("could not send notification request to host\n"); - sdb_close(sock); - return -1; - } - sdb_close(sock); - D("sent notification request to host\n"); - - return 0; -} - int connect_nonb(int sockfd, const struct sockaddr *saptr, socklen_t salen, int nsec) { int flags, n, error; @@ -588,7 +509,7 @@ static int send_msg_to_localhost_from_guest(const char *host_ip, int local_port, } // send the "emulator" request to sdbserver -static void notify_sdbd_startup_thread() { +static void* notify_sdbd_startup_thread(void* ptr) { char buffer[512]; char request[512]; @@ -605,11 +526,11 @@ static void notify_sdbd_startup_thread() { int time = 0; //int try_limit_time = -1; // try_limit_time < 0 if unlimited if (sensors_port < 0 || emulator_port < 0 || r < 0) { - return; + return NULL; } if (get_emulator_hostip(host_ip, sizeof host_ip) == -1) { D("failed to get emulator host ip\n"); - return; + return NULL; } // XXX: Known issue - log collision while (1) { diff --git a/src/usb_funcfs_client.c b/src/usb_funcfs_client.c index ef28284..75d90aa 100644 --- a/src/usb_funcfs_client.c +++ b/src/usb_funcfs_client.c @@ -297,7 +297,7 @@ static int read_control(struct usb_handle *usb) /* Read events from control endpoint Fortunately, FunctionFS guarantees reading of full event (or nothing), so we're not bothered with ret < sizeof(read_event) */ - ret = sdb_read(usb->control, &read_event, sizeof(read_event)); + ret = sdb_read(usb->control, (void *)&read_event, sizeof(read_event)); if (ret < 0) { /* EAGAIN support will be useful, when non-blocking ep0 reads are supported in FunctionFS */ @@ -548,7 +548,7 @@ int ffs_usb_write(usb_handle *h, const void *data, int len) * * @returns 0 on success and -1 on failure (errno is set) */ -int ffs_usb_read(usb_handle *h, void *data, int len) +int ffs_usb_read(usb_handle *h, void *data, size_t len) { int n; diff --git a/src/usb_libusb.c b/src/usb_libusb.c index 8d12ea7..fc3596f 100644 --- a/src/usb_libusb.c +++ b/src/usb_libusb.c @@ -171,7 +171,7 @@ usb_write(struct usb_handle *uh, const void *_data, int len) } int -usb_read(struct usb_handle *uh, void *_data, int len) +usb_read(struct usb_handle *uh, void *_data, size_t len) { unsigned char *data = (unsigned char*) _data; int n; diff --git a/src/usb_linux.c b/src/usb_linux.c index d7e8399..95f2ee9 100644 --- a/src/usb_linux.c +++ b/src/usb_linux.c @@ -454,7 +454,7 @@ int usb_write(usb_handle *h, const void *_data, int len) return 0; } -int usb_read(usb_handle *h, void *_data, int len) +int usb_read(usb_handle *h, void *_data, size_t len) { unsigned char *data = (unsigned char*) _data; int n; diff --git a/src/usb_linux_client.c b/src/usb_linux_client.c index d2af0c4..ec8c159 100644 --- a/src/usb_linux_client.c +++ b/src/usb_linux_client.c @@ -94,7 +94,7 @@ int linux_usb_write(usb_handle *h, const void *data, int len) return 0; } -int linux_usb_read(usb_handle *h, void *data, unsigned len) +int linux_usb_read(usb_handle *h, void *data, size_t len) { int n; diff --git a/src/utils.c b/src/utils.c index ae7d51d..acf8c5a 100644 --- a/src/utils.c +++ b/src/utils.c @@ -151,7 +151,7 @@ char *str_trim(char *str) { return str; } -int spawn(char* program, char** arg_list) +int spawn(const char* program, char* const arg_list[]) { pid_t pid; int ret; @@ -167,7 +167,7 @@ int spawn(char* program, char** arg_list) // init takes the process, and the process is not able to be zombie exit(0); } - execvp (program, arg_list); + execvp(program, arg_list); fprintf(stderr, "failed to spawn: never reach here!:%s\n", program); exit(0); } diff --git a/src/utils.h b/src/utils.h index 11a63c8..ce17442 100644 --- a/src/utils.h +++ b/src/utils.h @@ -72,7 +72,7 @@ char *str_trim(char* string); * spawn a process and returns the process id of the new spawned process. * it is working as async. */ -int spawn(char* program, char** arg_list); +int spawn(const char* program, char * const arg_list[]); char** str_split(char* a_str, const char a_delim);