projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanup: consumerd: use PERROR rather than perror
[lttng-tools.git]
/
src
/
bin
/
lttng-consumerd
/
lttng-consumerd.c
diff --git
a/src/bin/lttng-consumerd/lttng-consumerd.c
b/src/bin/lttng-consumerd/lttng-consumerd.c
index 299776aa00400ea6ab806cb98a49f1a1b0e30f98..d2c3ed4ed605174aa2d0f4e0b12afc0c39b0dfee 100644
(file)
--- a/
src/bin/lttng-consumerd/lttng-consumerd.c
+++ b/
src/bin/lttng-consumerd/lttng-consumerd.c
@@
-53,8
+53,6
@@
#include "lttng-consumerd.h"
#include "health-consumerd.h"
#include "lttng-consumerd.h"
#include "health-consumerd.h"
-/* TODO : support UST (all direct kernel-ctl accesses). */
-
/* threads (channel handling, poll, metadata, sessiond) */
static pthread_t channel_thread, data_thread, metadata_thread,
/* threads (channel handling, poll, metadata, sessiond) */
static pthread_t channel_thread, data_thread, metadata_thread,
@@
-124,7
+122,7
@@
static int set_signal_handler(void)
sigset_t sigset;
if ((ret = sigemptyset(&sigset)) < 0) {
sigset_t sigset;
if ((ret = sigemptyset(&sigset)) < 0) {
-
perror
("sigemptyset");
+
PERROR
("sigemptyset");
return ret;
}
return ret;
}
@@
-132,17
+130,17
@@
static int set_signal_handler(void)
sa.sa_mask = sigset;
sa.sa_flags = 0;
if ((ret = sigaction(SIGTERM, &sa, NULL)) < 0) {
sa.sa_mask = sigset;
sa.sa_flags = 0;
if ((ret = sigaction(SIGTERM, &sa, NULL)) < 0) {
-
perror
("sigaction");
+
PERROR
("sigaction");
return ret;
}
if ((ret = sigaction(SIGINT, &sa, NULL)) < 0) {
return ret;
}
if ((ret = sigaction(SIGINT, &sa, NULL)) < 0) {
-
perror
("sigaction");
+
PERROR
("sigaction");
return ret;
}
if ((ret = sigaction(SIGPIPE, &sa, NULL)) < 0) {
return ret;
}
if ((ret = sigaction(SIGPIPE, &sa, NULL)) < 0) {
-
perror
("sigaction");
+
PERROR
("sigaction");
return ret;
}
return ret;
}
@@
-186,9
+184,9
@@
static void usage(FILE *fp)
/*
* daemon argument parsing
*/
/*
* daemon argument parsing
*/
-static
void
parse_args(int argc, char **argv)
+static
int
parse_args(int argc, char **argv)
{
{
- int c;
+ int c
, ret = 0
;
static struct option long_options[] = {
{ "consumerd-cmd-sock", 1, 0, 'c' },
static struct option long_options[] = {
{ "consumerd-cmd-sock", 1, 0, 'c' },
@@
-218,6
+216,8
@@
static void parse_args(int argc, char **argv)
fprintf(stderr, "option %s", long_options[option_index].name);
if (optarg) {
fprintf(stderr, " with arg %s\n", optarg);
fprintf(stderr, "option %s", long_options[option_index].name);
if (optarg) {
fprintf(stderr, " with arg %s\n", optarg);
+ ret = -1;
+ goto end;
}
break;
case 'c':
}
break;
case 'c':
@@
-260,9
+260,12
@@
static void parse_args(int argc, char **argv)
#endif
default:
usage(stderr);
#endif
default:
usage(stderr);
- exit(EXIT_FAILURE);
+ ret = -1;
+ goto end;
}
}
}
}
+end:
+ return ret;
}
/*
}
/*
This page took
0.02591 seconds
and
4
git commands to generate.