summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2015-09-23 00:05:57 (GMT)
committerChristian Pointner <equinox@spreadspace.org>2015-09-23 00:05:57 (GMT)
commitaadcfc01bc54ec99a5a6b6b980f05d30c634b549 (patch)
tree9a7552770d652c031fca5968a96359b242ae1c6b
parent71288f0b3194055e2300667e5a2bc2b75eb83e04 (diff)
refactored some function names
-rw-r--r--src/dropnroll.c4
-rw-r--r--src/sysexec.c10
-rw-r--r--src/sysexec.h6
3 files changed, 10 insertions, 10 deletions
diff --git a/src/dropnroll.c b/src/dropnroll.c
index a3bd97f..e0bd08b 100644
--- a/src/dropnroll.c
+++ b/src/dropnroll.c
@@ -114,7 +114,7 @@ int process_watch(int inotify_fd, read_buffer_t* buffer, watch_list_t* watch_lst
char* const argv[] = { opt->script_, path, event->len > 0 ? event->name : "", buf, NULL };
char* const evp[] = { NULL };
- if(!rh_exec(opt->script_, argv, evp, child_lst, opt)) {
+ if(!dnr_exec(opt->script_, argv, evp, child_lst, opt)) {
snprintf(buf, 100, "new file in '%s', name='%s'", path, event->len > 0 ? event->name : "");
log_printf(NOTICE, "%s, executing script %s", buf, opt->script_);
client_t* client;
@@ -410,7 +410,7 @@ int main_loop(int cmd_listen_fd, int inotify_fd, options_t* opt)
if(ret == -1)
continue;
if(!ret) {
- rh_waitpid(&child_lst, opt);
+ dnr_waitpid(&child_lst, opt);
continue;
}
diff --git a/src/sysexec.c b/src/sysexec.c
index 6f606ff..d2ae341 100644
--- a/src/sysexec.c
+++ b/src/sysexec.c
@@ -274,7 +274,7 @@ void child_list_kill_oldest(child_list_t* list)
}
}
-int rh_exec(const char* script, char* const argv[], char* const evp[], child_list_t* child_lst, options_t* opt)
+int dnr_exec(const char* script, char* const argv[], char* const evp[], child_list_t* child_lst, options_t* opt)
{
if(!script)
return -1;
@@ -292,14 +292,14 @@ int rh_exec(const char* script, char* const argv[], char* const evp[], child_lis
return -3;
}
- int ret = rh_exec_child(child);
+ int ret = dnr_exec_child(child);
if(ret)
child_list_rm(child_lst, child);
return ret;
}
-int rh_exec_child(child_list_element_t* child)
+int dnr_exec_child(child_list_element_t* child)
{
if(!child || child->pid_ != -1)
return -1;
@@ -355,7 +355,7 @@ int rh_exec_child(child_list_element_t* child)
return 0;
}
-int rh_waitpid(child_list_t* child_lst, options_t* opt)
+int dnr_waitpid(child_list_t* child_lst, options_t* opt)
{
int status = 0;
pid_t pid = waitpid(-1, &status, WNOHANG);
@@ -397,7 +397,7 @@ int rh_waitpid(child_list_t* child_lst, options_t* opt)
child_list_rm_pid(child_lst, pid);
if(child_list_num_running(child_lst) < opt->max_children_)
- rh_exec_child(child_list_find(child_lst, -1));
+ dnr_exec_child(child_list_find(child_lst, -1));
return status;
}
diff --git a/src/sysexec.h b/src/sysexec.h
index 4345a15..783b12d 100644
--- a/src/sysexec.h
+++ b/src/sysexec.h
@@ -53,8 +53,8 @@ child_list_element_t* child_list_find(child_list_t* list, pid_t pid);
int child_list_num_running(child_list_t* list);
void child_list_kill_oldest(child_list_t* list);
-int rh_exec(const char* script, char* const argv[], char* const evp[], child_list_t* child_lst, options_t* opt);
-int rh_exec_child(child_list_element_t* child);
-int rh_waitpid(child_list_t* child_lst, options_t* opt);
+int dnr_exec(const char* script, char* const argv[], char* const evp[], child_list_t* child_lst, options_t* opt);
+int dnr_exec_child(child_list_element_t* child);
+int dnr_waitpid(child_list_t* child_lst, options_t* opt);
#endif