]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
Rename getline_wrapped() to freadline_wrapped()
authorLucas De Marchi <lucas.demarchi@intel.com>
Fri, 3 Oct 2014 06:25:06 +0000 (03:25 -0300)
committerLucas De Marchi <lucas.demarchi@intel.com>
Fri, 3 Oct 2014 06:25:06 +0000 (03:25 -0300)
libkmod/libkmod-config.c
shared/util.c
shared/util.h
testsuite/rootfs-pristine/test-util/freadline_wrapped-correct.txt [moved from testsuite/rootfs-pristine/test-util/getline_wrapped-correct.txt with 100% similarity]
testsuite/rootfs-pristine/test-util/freadline_wrapped-input.txt [moved from testsuite/rootfs-pristine/test-util/getline_wrapped-input.txt with 100% similarity]
testsuite/test-util.c
tools/depmod.c

index e248d3c3a8e9b42ecb94897eef19f170a3c4acbf..3dbf6c2d773e28e42ccd607a4a899c473d950dd6 100644 (file)
@@ -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] == '#')
index 0113967cbb1628afc85b72e070ca412f820c07ea..8491b18c5c74a30c18abedd60ca58b2ea88bca4e 100644 (file)
@@ -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;
index 1ed721471c9653292bc52c4c26282fabe7bf5d51..7fcb242e89c309fe5b0c988fd15abc23fd6bfc35 100644 (file)
@@ -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                                                  */
 /* ************************************************************************ */
index 17f242234ab2dea52e5de2e3e3dc2c78e861fccd..30032b7cfcb8e28476bfcd44c795ac810589c6b9 100644 (file)
@@ -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,
 };
 
index cb46e0ce42d079ed8b135672802df7d50548ca6b..74bc41fad03255d717bab9a9c16eede9cdb21ce2 100644 (file)
@@ -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] == '#')