Commit bfa3f007 by Serge Hallyn Committed by Stéphane Graber

remove unused lxc_read_line_from_file()

parent 0e95426b
...@@ -869,30 +869,3 @@ int lxc_read_from_file(const char *filename, void* buf, size_t count) ...@@ -869,30 +869,3 @@ int lxc_read_from_file(const char *filename, void* buf, size_t count)
errno = saved_errno; errno = saved_errno;
return ret; return ret;
} }
char *lxc_read_line_from_file(const char *filename)
{
FILE *f;
char *line = NULL;
int saved_errno;
size_t sz = 0;
f = fopen_cloexec(filename, "r");
if (!f)
return NULL;
if (getline(&line, &sz, f) == -1) {
saved_errno = errno;
fclose(f);
errno = saved_errno;
return NULL;
}
fclose(f);
/* trim line, if necessary */
if (strlen(line) > 0 && line[strlen(line) - 1] == '\n')
line[strlen(line) - 1] = '\0';
return line;
}
...@@ -197,7 +197,6 @@ extern int sha1sum_file(char *fnam, unsigned char *md_value); ...@@ -197,7 +197,6 @@ extern int sha1sum_file(char *fnam, unsigned char *md_value);
/* read and write whole files */ /* read and write whole files */
extern int lxc_write_to_file(const char *filename, const void* buf, size_t count, bool add_newline); extern int lxc_write_to_file(const char *filename, const void* buf, size_t count, bool add_newline);
extern int lxc_read_from_file(const char *filename, void* buf, size_t count); extern int lxc_read_from_file(const char *filename, void* buf, size_t count);
extern char *lxc_read_line_from_file(const char *filename);
/* convert variadic argument lists to arrays (for execl type argument lists) */ /* convert variadic argument lists to arrays (for execl type argument lists) */
extern char** lxc_va_arg_list_to_argv(va_list ap, size_t skip, int do_strdup); extern char** lxc_va_arg_list_to_argv(va_list ap, size_t skip, int do_strdup);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment