Skip to content

Commit

Permalink
remove the rc_gitline function from librc
Browse files Browse the repository at this point in the history
  • Loading branch information
williamh committed Jan 16, 2023
1 parent da29468 commit 3af59e9
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 46 deletions.
16 changes: 0 additions & 16 deletions FEATURE-REMOVAL-SCHEDULE.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,3 @@ Why: /etc/mtab should be a symbolic link to /proc/self/mounts on modern
Linux systems

Who:

# C API Functions in rc.h

If you have a c program that links to librc and uses functions from
there, this section will list API functions which are deprecated and
will be removed along with the reason they are being removed.

## rc_getline()

When: 1.0

Why: The getline() function was standardized in POSIX.1-2008, so it
should be available on POSIX systems.

Who:

24 changes: 0 additions & 24 deletions src/librc/librc-misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,30 +92,6 @@ rc_getfile(const char *file, char **buffer, size_t *len)
return ret;
}

ssize_t
rc_getline(char **line, size_t *len, FILE *fp)
{
char *p;
size_t last = 0;

while (!feof(fp)) {
if (*line == NULL || last != 0) {
*len += BUFSIZ;
*line = xrealloc(*line, *len);
}
p = *line + last;
memset(p, 0, BUFSIZ);
if (fgets(p, BUFSIZ, fp) == NULL)
break;
last += strlen(p);
if (last && (*line)[last - 1] == '\n') {
(*line)[last - 1] = '\0';
break;
}
}
return last;
}

char *
rc_proc_getent(const char *ent _unused)
{
Expand Down
6 changes: 1 addition & 5 deletions src/librc/rc.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -601,13 +601,9 @@ typedef LIST_HEAD(rc_pidlist, rc_pid) RC_PIDLIST;
* @return NULL terminated list of pids */
RC_PIDLIST *rc_find_pids(const char *, const char *const *, uid_t, pid_t);

/* Basically the same as rc_getline() below, it just returns multiple lines */
/* Basically the same as getline() , it just returns multiple lines */
bool rc_getfile(const char *, char **, size_t *);

/* getline is a handy glibc function that not all libcs have, so
* we have our own */
ssize_t rc_getline(char **, size_t *, FILE *);

/* __END_DECLS */
#ifdef __cplusplus
}
Expand Down
1 change: 0 additions & 1 deletion src/librc/rc.map
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ global:
rc_environ_fd;
rc_find_pids;
rc_getfile;
rc_getline;
rc_newer_than;
rc_older_than;
rc_proc_getent;
Expand Down

0 comments on commit 3af59e9

Please sign in to comment.