From 83e6d192cbe160dbea62427bab0f6f7d490ce215 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 5 Jun 2018 15:21:47 +0200 Subject: main: split out reading of /proc/sys/fs/nr_open into its own function This doesn't really reduce the code size over all, but it does make main.c shorter and more readable, and that's always a good thing. --- src/test/test-fd-util.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/test') diff --git a/src/test/test-fd-util.c b/src/test/test-fd-util.c index edcb8ab75..d50810c01 100644 --- a/src/test/test-fd-util.c +++ b/src/test/test-fd-util.c @@ -317,7 +317,14 @@ static void test_fd_duplicate_data_fd(void) { assert_se(read(fd2, &j, sizeof(j)) == 0); } +static void test_read_nr_open(void) { + log_info("nr-open: %i", read_nr_open()); +} + int main(int argc, char *argv[]) { + + log_set_max_level(LOG_DEBUG); + test_close_many(); test_close_nointr(); #if 0 /// UNNEEDED by elogind @@ -328,6 +335,7 @@ int main(int argc, char *argv[]) { test_fd_move_above_stdio(); test_rearrange_stdio(); test_fd_duplicate_data_fd(); + test_read_nr_open(); return 0; } -- cgit v1.2.3