ret = stat(path, &buf);
if (ret == -1 && errno == ENOENT) {
if (file_exist) {
- (void) poll(NULL, 0, 10); /* 10 ms delay */
- continue; /* retry */
+ /*
+ * The file does not exist. wait a bit and
+ * continue looping until it does.
+ */
+ (void) poll(NULL, 0, 10);
+ continue;
}
- break; /* File does not exist */
+
+ /*
+ * File does not exist and the exit condition we want.
+ * Break from the loop and return.
+ */
+ break;
}
if (ret) {
perror("stat");
exit(EXIT_FAILURE);
}
- break; /* found */
+ /*
+ * stat() returned 0, so the file exists. break now only if
+ * that's the exit condition we want.
+ */
+ if (file_exist) {
+ break;
+ }
}
}
+static
int write_pipe(const char *path, uint8_t data)
{
int ret = 0;
return ret;
}
+static
int stop_consumer(const char **argv)
{
int ret = 0, i;
return ret;
}
+static
int resume_consumer(const char **argv)
{
int ret = 0, i;
return ret;
}
-int suspend_application()
+static
+int suspend_application(void)
{
int ret;
struct stat buf;
}
+static
int resume_application()
{
int ret;
}
+static
void test_triggers_buffer_usage_condition(const char *session_name,
const char *channel_name,
enum lttng_domain_type domain_type,
assert("Logic error for test vector generation");
}
- loop_ret = asprintf(&test_tuple_string, "session name %s, channel name %s, threshold ratio %s, threshold byte %s, domain type %s",
+ loop_ret = asprintf(&test_tuple_string, "session name %s, channel name %s, threshold ratio %s, threshold byte %s, domain type %s",
session_name_set ? "set" : "unset",
channel_name_set ? "set" : "unset",
threshold_ratio_set ? "set" : "unset",
} while (ret != 0);
}
+static
void test_notification_channel(const char *session_name, const char *channel_name, const enum lttng_domain_type domain_type, const char **argv)
{
int ret = 0;