diff options
author | bapt <bapt@FreeBSD.org> | 2016-05-10 11:11:23 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2016-05-10 11:11:23 +0000 |
commit | 9af4744a94145acbc3cbf6897ed72229f2941569 (patch) | |
tree | 2b1c7ed92eaf14e09f082db3b5ce30b7b4af6c2e /bin | |
parent | a1263689538eb95c37d276455022a70c8d8ba5a2 (diff) | |
download | FreeBSD-src-9af4744a94145acbc3cbf6897ed72229f2941569.zip FreeBSD-src-9af4744a94145acbc3cbf6897ed72229f2941569.tar.gz |
Rename getline with get_line to avoid collision with getline(3)
When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added.
This rename is made in preparation for the removal of this guard
Obtained from: NetBSD
Diffstat (limited to 'bin')
-rw-r--r-- | bin/pax/options.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/bin/pax/options.c b/bin/pax/options.c index 06e487c..094b47e 100644 --- a/bin/pax/options.c +++ b/bin/pax/options.c @@ -68,7 +68,7 @@ static int no_op(void); static void printflg(unsigned int); static int c_frmt(const void *, const void *); static off_t str_offt(char *); -static char *getline(FILE *fp); +static char *get_line(FILE *fp); static void pax_options(int, char **); static void pax_usage(void); static void tar_options(int, char **); @@ -76,10 +76,10 @@ static void tar_usage(void); static void cpio_options(int, char **); static void cpio_usage(void); -/* errors from getline */ +/* errors from get_line */ #define GETLINE_FILE_CORRUPT 1 #define GETLINE_OUT_OF_MEM 2 -static int getline_error; +static int get_line_error; char *chdname; @@ -873,14 +873,14 @@ tar_options(int argc, char **argv) paxwarn(1, "Unable to open file '%s' for read", file); tar_usage(); } - while ((str = getline(fp)) != NULL) { + while ((str = get_line(fp)) != NULL) { if (pat_add(str, dir) < 0) tar_usage(); sawpat = 1; } if (strcmp(file, "-") != 0) fclose(fp); - if (getline_error) { + if (get_line_error) { paxwarn(1, "Problem with file '%s'", file); tar_usage(); } @@ -946,13 +946,13 @@ tar_options(int argc, char **argv) paxwarn(1, "Unable to open file '%s' for read", file); tar_usage(); } - while ((str = getline(fp)) != NULL) { + while ((str = get_line(fp)) != NULL) { if (ftree_add(str, 0) < 0) tar_usage(); } if (strcmp(file, "-") != 0) fclose(fp); - if (getline_error) { + if (get_line_error) { paxwarn(1, "Problem with file '%s'", file); tar_usage(); @@ -1159,11 +1159,11 @@ cpio_options(int argc, char **argv) paxwarn(1, "Unable to open file '%s' for read", optarg); cpio_usage(); } - while ((str = getline(fp)) != NULL) { + while ((str = get_line(fp)) != NULL) { pat_add(str, NULL); } fclose(fp); - if (getline_error) { + if (get_line_error) { paxwarn(1, "Problem with file '%s'", optarg); cpio_usage(); } @@ -1258,10 +1258,10 @@ cpio_options(int argc, char **argv) * no read errors allowed on updates/append operation! */ maxflt = 0; - while ((str = getline(stdin)) != NULL) { + while ((str = get_line(stdin)) != NULL) { ftree_add(str, 0); } - if (getline_error) { + if (get_line_error) { paxwarn(1, "Problem while reading stdin"); cpio_usage(); } @@ -1489,21 +1489,21 @@ str_offt(char *val) } char * -getline(FILE *f) +get_line(FILE *f) { char *name, *temp; size_t len; name = fgetln(f, &len); if (!name) { - getline_error = ferror(f) ? GETLINE_FILE_CORRUPT : 0; + get_line_error = ferror(f) ? GETLINE_FILE_CORRUPT : 0; return(0); } if (name[len-1] != '\n') len++; temp = malloc(len); if (!temp) { - getline_error = GETLINE_OUT_OF_MEM; + get_line_error = GETLINE_OUT_OF_MEM; return(0); } memcpy(temp, name, len-1); |