diff options
author | Lucas De Marchi <lucas.demarchi@intel.com> | 2014-10-03 03:25:06 -0300 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@intel.com> | 2014-10-03 03:25:06 -0300 |
commit | aafd38359adfd93b1f8c1e84b8bd7bc9e1b0b6cf (patch) | |
tree | 863b308278424abf9486c00e12942af67d794208 | |
parent | b18979b770b391d81ad45372f1670297c836b640 (diff) | |
download | kmod-aafd38359adfd93b1f8c1e84b8bd7bc9e1b0b6cf.tar.gz |
Rename getline_wrapped() to freadline_wrapped()
-rw-r--r-- | libkmod/libkmod-config.c | 2 | ||||
-rw-r--r-- | shared/util.c | 2 | ||||
-rw-r--r-- | shared/util.h | 2 | ||||
-rw-r--r-- | testsuite/rootfs-pristine/test-util/freadline_wrapped-correct.txt (renamed from testsuite/rootfs-pristine/test-util/getline_wrapped-correct.txt) | 0 | ||||
-rw-r--r-- | testsuite/rootfs-pristine/test-util/freadline_wrapped-input.txt (renamed from testsuite/rootfs-pristine/test-util/getline_wrapped-input.txt) | 0 | ||||
-rw-r--r-- | testsuite/test-util.c | 14 | ||||
-rw-r--r-- | tools/depmod.c | 2 |
7 files changed, 11 insertions, 11 deletions
diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c index e248d3c..3dbf6c2 100644 --- a/libkmod/libkmod-config.c +++ b/libkmod/libkmod-config.c @@ -595,7 +595,7 @@ static int kmod_config_parse(struct kmod_config *config, int fd, return err; } - while ((line = getline_wrapped(fp, &linenum)) != NULL) { + while ((line = freadline_wrapped(fp, &linenum)) != NULL) { char *cmd, *saveptr; if (line[0] == '\0' || line[0] == '#') diff --git a/shared/util.c b/shared/util.c index 0113967..8491b18 100644 --- a/shared/util.c +++ b/shared/util.c @@ -160,7 +160,7 @@ int read_str_ulong(int fd, unsigned long *value, int base) * If linenum is not NULL, it is incremented by the number of physical lines * which have been read. */ -char *getline_wrapped(FILE *fp, unsigned int *linenum) +char *freadline_wrapped(FILE *fp, unsigned int *linenum) { int size = 256; int i = 0, n = 0; diff --git a/shared/util.h b/shared/util.h index 1ed7214..7fcb242 100644 --- a/shared/util.h +++ b/shared/util.h @@ -22,7 +22,7 @@ ssize_t read_str_safe(int fd, char *buf, size_t buflen) _must_check_ __attribute ssize_t write_str_safe(int fd, const char *buf, size_t buflen) __attribute__((nonnull(2))); int read_str_long(int fd, long *value, int base) _must_check_ __attribute__((nonnull(2))); int read_str_ulong(int fd, unsigned long *value, int base) _must_check_ __attribute__((nonnull(2))); -char *getline_wrapped(FILE *fp, unsigned int *linenum) __attribute__((nonnull(1))); +char *freadline_wrapped(FILE *fp, unsigned int *linenum) __attribute__((nonnull(1))); /* path handling functions */ /* ************************************************************************ */ diff --git a/testsuite/rootfs-pristine/test-util/getline_wrapped-correct.txt b/testsuite/rootfs-pristine/test-util/freadline_wrapped-correct.txt index 87344ab..87344ab 100644 --- a/testsuite/rootfs-pristine/test-util/getline_wrapped-correct.txt +++ b/testsuite/rootfs-pristine/test-util/freadline_wrapped-correct.txt diff --git a/testsuite/rootfs-pristine/test-util/getline_wrapped-input.txt b/testsuite/rootfs-pristine/test-util/freadline_wrapped-input.txt index f84a852..f84a852 100644 --- a/testsuite/rootfs-pristine/test-util/getline_wrapped-input.txt +++ b/testsuite/rootfs-pristine/test-util/freadline_wrapped-input.txt diff --git a/testsuite/test-util.c b/testsuite/test-util.c index 17f2422..30032b7 100644 --- a/testsuite/test-util.c +++ b/testsuite/test-util.c @@ -70,16 +70,16 @@ static DEFINE_TEST(alias_1, .out = TESTSUITE_ROOTFS "test-util/alias-correct.txt", }); -static int test_getline_wrapped(const struct test *t) +static int test_freadline_wrapped(const struct test *t) { - FILE *fp = fopen("/getline_wrapped-input.txt", "re"); + FILE *fp = fopen("/freadline_wrapped-input.txt", "re"); if (!fp) return EXIT_FAILURE; while (!feof(fp) && !ferror(fp)) { unsigned int num = 0; - char *s = getline_wrapped(fp, &num); + char *s = freadline_wrapped(fp, &num); if (!s) break; puts(s); @@ -90,19 +90,19 @@ static int test_getline_wrapped(const struct test *t) fclose(fp); return EXIT_SUCCESS; } -static DEFINE_TEST(test_getline_wrapped, - .description = "check if getline_wrapped() does the right thing", +static DEFINE_TEST(test_freadline_wrapped, + .description = "check if freadline_wrapped() does the right thing", .config = { [TC_ROOTFS] = TESTSUITE_ROOTFS "test-util/", }, .need_spawn = true, .output = { - .out = TESTSUITE_ROOTFS "test-util/getline_wrapped-correct.txt", + .out = TESTSUITE_ROOTFS "test-util/freadline_wrapped-correct.txt", }); static const struct test *tests[] = { &salias_1, - &stest_getline_wrapped, + &stest_freadline_wrapped, NULL, }; diff --git a/tools/depmod.c b/tools/depmod.c index cb46e0c..74bc41f 100644 --- a/tools/depmod.c +++ b/tools/depmod.c @@ -686,7 +686,7 @@ static int cfg_file_parse(struct cfg *cfg, const char *filename) return err; } - while ((line = getline_wrapped(fp, &linenum)) != NULL) { + while ((line = freadline_wrapped(fp, &linenum)) != NULL) { char *cmd, *saveptr; if (line[0] == '\0' || line[0] == '#') |