mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zdev: Remove misc_readlink() helper function
zdev uses util_readlink() now and there are no users left for misc_readlink() anymore. Remove it. Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com> Signed-off-by: Jan Polensky <japo@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
8ad28f7856
commit
df8aac7084
@@ -181,7 +181,6 @@ char *config_read_cmd_output(const char *, int, err_t);
|
|||||||
exit_code_t misc_write_text_file(const char *, const char *, err_t);
|
exit_code_t misc_write_text_file(const char *, const char *, err_t);
|
||||||
exit_code_t misc_write_text_file_retry(const char *, const char *, err_t);
|
exit_code_t misc_write_text_file_retry(const char *, const char *, err_t);
|
||||||
exit_code_t misc_mktemp(char **, int *);
|
exit_code_t misc_mktemp(char **, int *);
|
||||||
char *misc_readlink(const char *path);
|
|
||||||
config_t get_config(int act, int pers, int ac);
|
config_t get_config(int act, int pers, int ac);
|
||||||
bool is_zvm(void);
|
bool is_zvm(void);
|
||||||
bool is_terminal(void);
|
bool is_terminal(void);
|
||||||
|
|||||||
@@ -1047,28 +1047,6 @@ exit_code_t misc_write_text_file_retry(const char *path, const char *text,
|
|||||||
return rc == 0 ? EXIT_OK : EXIT_RUNTIME_ERROR;
|
return rc == 0 ? EXIT_OK : EXIT_RUNTIME_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define READLINE_SIZE 4096
|
|
||||||
|
|
||||||
/* Return a newly allocated string containing the contents of the symbolic link
|
|
||||||
* at the specified path or NULL on error. */
|
|
||||||
char *misc_readlink(const char *path)
|
|
||||||
{
|
|
||||||
char *name, *name2;
|
|
||||||
ssize_t len;
|
|
||||||
|
|
||||||
debug("Reading link %s\n", path);
|
|
||||||
name = misc_malloc(READLINE_SIZE);
|
|
||||||
len = readlink(path, name, READLINE_SIZE - 1);
|
|
||||||
if (len < 0) {
|
|
||||||
free(name);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
name[len++] = 0;
|
|
||||||
|
|
||||||
name2 = realloc(name, len);
|
|
||||||
return (name2) ? name2 : name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Determine configuration set. */
|
/* Determine configuration set. */
|
||||||
config_t get_config(int active, int persistent, int autoconf)
|
config_t get_config(int active, int persistent, int autoconf)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user