X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=tests%2Funit%2Ftest_fd_tracker.cpp;h=cdc622a04e463e30dbdd6971bd3e6a03d55f39ab;hb=refs%2Fheads%2Fmaster;hp=9e40c83c2ab5499893a8139f74468b4b014d4730;hpb=cd9adb8b829564212158943a0d279bb35322ab30;p=lttng-tools.git diff --git a/tests/unit/test_fd_tracker.cpp b/tests/unit/test_fd_tracker.cpp index 9e40c83c2..b9924e3bc 100644 --- a/tests/unit/test_fd_tracker.cpp +++ b/tests/unit/test_fd_tracker.cpp @@ -167,8 +167,8 @@ static void untrack_std_fds(struct fd_tracker *tracker) }; for (i = 0; i < sizeof(files) / sizeof(*files); i++) { - int fd = files[i].fd; - int ret = fd_tracker_close_unsuspendable_fd( + const int fd = files[i].fd; + const int ret = fd_tracker_close_unsuspendable_fd( tracker, &files[i].fd, 1, noop_close, nullptr); ok(ret == 0, "Untrack unsuspendable fd %d (%s)", fd, files[i].name); @@ -299,7 +299,7 @@ static int open_pipes(void *data __attribute__((unused)), int *out_fds) const unsigned int pipe_count = TRACKER_FD_LIMIT / 2; for (i = 0; i < pipe_count; i++) { - int ret = pipe(&out_fds[i * 2]); + const int ret = pipe(&out_fds[i * 2]); if (ret) { return -errno; @@ -314,7 +314,7 @@ static int close_pipes(void *data __attribute__((unused)), int *fds) int *pipes = fds; for (i = 0; i < TRACKER_FD_LIMIT; i++) { - int ret = close(pipes[i]); + const int ret = close(pipes[i]); if (ret) { return -errno; @@ -704,7 +704,7 @@ skip_write: break; } - if (strcmp(file_contents, read_buf)) { + if (strcmp(file_contents, read_buf) != 0) { content_ok = false; diag("File content doesn't match the expectated string"); (void) close(fd);