/*
- * Copyright (c) - 2018 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ * Copyright (C) 2018 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by as
- * published by the Free Software Foundation; only version 2 of the License.
+ * SPDX-License-Identifier: GPL-2.0-only
*
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdlib.h>
ok(tracker, "Created an fd tracker with a limit of %d simulateously opened file descriptors",
TRACKER_FD_LIMIT);
if (!tracker) {
- return;
+ goto end;
}
track_std_fds(tracker);
fd_tracker_destroy(tracker);
ret = rmdir(test_directory);
ok(ret == 0, "Test directory is empty");
+end:
free(test_directory);
free(unlinked_files_directory);
}
tracker = fd_tracker_create(unlinked_files_directory, TRACKER_FD_LIMIT);
if (!tracker) {
- return;
+ goto end;;
}
ret = pipe(unknown_fds);
fd_tracker_destroy(tracker);
ret = rmdir(test_directory);
ok(ret == 0, "Test directory is empty");
+end:
free(test_directory);
free(unlinked_files_directory);
}
tracker = fd_tracker_create(unlinked_files_directory, TRACKER_FD_LIMIT);
if (!tracker) {
- return;
+ goto end;
}
dir_handle = lttng_directory_handle_create(test_directory);
ok(ret == 0, "Test directory is empty");
fd_tracker_destroy(tracker);
lttng_directory_handle_put(dir_handle);
+end:
free(test_directory);
free(unlinked_files_directory);
}
tracker = fd_tracker_create(unlinked_files_directory, TRACKER_FD_LIMIT);
if (!tracker) {
- return;
+ goto end;
}
dir_handle = lttng_directory_handle_create(test_directory);
ok(ret == 0, "Test directory is empty");
fd_tracker_destroy(tracker);
lttng_directory_handle_put(dir_handle);
+end:
free(test_directory);
free(unlinked_files_directory);
}
tracker = fd_tracker_create(unlinked_files_directory, TRACKER_FD_LIMIT);
if (!tracker) {
- return;
+ goto end;
}
dir_handle = lttng_directory_handle_create(test_directory);
ok(ret == 0, "Test directory is empty");
fd_tracker_destroy(tracker);
lttng_directory_handle_put(dir_handle);
+end:
free(test_directory);
free(unlinked_files_directory);
}
tracker = fd_tracker_create(unlinked_files_directory, 1);
if (!tracker) {
- return;
+ goto end;
}
dir_handle = lttng_directory_handle_create(test_directory);
ok(!ret, "Successfully opened %i handles to %s/%s", handles_to_open,
test_directory, file_name);
if (ret) {
- return;
+ goto end;
}
/*
ret = rmdir(test_directory);
ok(ret == 0, "Test directory is empty");
+end:
fd_tracker_destroy(tracker);
free(test_directory);
free(unlinked_files_directory);