73 char *buf,
size_t buf_size)
77 for (i = 0; servicenames[i].
c_name != NULL; i++) {
78 if (service_id == servicenames[i].
c_val) {
79 return (servicenames[i].
c_name);
82 snprintf(buf, buf_size,
"%d", service_id);
92 return ((strncmp ((
char *)name1->
value, (
char *)name2->
value,
106 if (gettimeofday(&tv, 0)) {
110 time_now = (
cs_time_t)(tv.tv_sec) * 1000000000ULL;
111 time_now += (
cs_time_t)(tv.tv_usec) * 1000ULL;
131 "Corosync Cluster Engine exiting normally");
134 "with status %d at %s:%u.", err, file, line);
140 #define min(a,b) ((a) < (b) ? (a) : (b))
148 memset (ret_name, 0,
sizeof (ret_name));
152 return ((
char *)name->
value);
156 strncpy ((
char *)name->
value, str, sizeof (name->
value) - 1);
157 ((
char *)name->
value)[
sizeof (name->
value) - 1] =
'\0';
161 name->
length = strlen (str);
166 if (str1->
length == strlen (str2)) {
167 return ((strncmp ((
char *)str1->
value, (
char *)str2,
176 static char path[PATH_MAX] = {
'\0'};
180 if (path[0] ==
'\0') {
181 env_run_dir = getenv(
"COROSYNC_RUN_DIR");
183 if (env_run_dir != NULL && env_run_dir[0] !=
'\0') {
184 res = snprintf(path, PATH_MAX,
"%s", getenv(
"COROSYNC_RUN_DIR"));
186 res = snprintf(path, PATH_MAX,
"%s/%s",
LOCALSTATEDIR,
"lib/corosync");
189 assert(res < PATH_MAX);