X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fexec.c;h=36f2d4da19021eae2a63d9684058422881a9d888;hb=849f5394cce97a76da080f6cd9e5194b7f4ee0f0;hp=8224d10b287c3a2de8079ffea0798ac57a723b7b;hpb=0b7cd83a5e6bac068ea83a88a5ddcfb07c09fbec;p=collectd.git diff --git a/src/exec.c b/src/exec.c index 8224d10b..36f2d4da 100644 --- a/src/exec.c +++ b/src/exec.c @@ -351,7 +351,6 @@ static int fork_child(program_list_t *pl, int *fd_in, int *fd_out, int fd_pipe_in[2] = {-1, -1}; int fd_pipe_out[2] = {-1, -1}; int fd_pipe_err[2] = {-1, -1}; - char errbuf[1024]; int status; int pid; @@ -380,7 +379,7 @@ static int fork_child(program_list_t *pl, int *fd_in, int *fd_out, status = getpwnam_r(pl->user, &sp, nambuf, sizeof(nambuf), &sp_ptr); if (status != 0) { ERROR("exec plugin: Failed to get user information for user ``%s'': %s", - pl->user, sstrerror(status, errbuf, sizeof(errbuf))); + pl->user, STRERROR(status)); goto failed; } @@ -415,7 +414,7 @@ static int fork_child(program_list_t *pl, int *fd_in, int *fd_out, if (status != 0) { ERROR("exec plugin: Failed to get group information " "for group ``%s'': %s", - pl->group, sstrerror(status, errbuf, sizeof(errbuf))); + pl->group, STRERROR(status)); goto failed; } if (gr_ptr == NULL) { @@ -789,7 +788,11 @@ static int exec_read(void) /* {{{ */ pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - plugin_thread_create(&t, &attr, exec_read_one, (void *)pl, "exec read"); + int status = + plugin_thread_create(&t, &attr, exec_read_one, (void *)pl, "exec read"); + if (status != 0) { + ERROR("exec plugin: plugin_thread_create failed."); + } pthread_attr_destroy(&attr); } /* for (pl) */ @@ -828,8 +831,11 @@ static int exec_notification(const notification_t *n, /* {{{ */ pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - plugin_thread_create(&t, &attr, exec_notification_one, (void *)pln, - "exec notify"); + int status = plugin_thread_create(&t, &attr, exec_notification_one, + (void *)pln, "exec notify"); + if (status != 0) { + ERROR("exec plugin: plugin_thread_create failed."); + } pthread_attr_destroy(&attr); } /* for (pl) */