diff options
Diffstat (limited to 'misc')
| -rw-r--r-- | misc/subr.c | 26 | ||||
| -rw-r--r-- | misc/subr.h | 2 |
2 files changed, 0 insertions, 28 deletions
diff --git a/misc/subr.c b/misc/subr.c index e16a7dc..30b4f3e 100644 --- a/misc/subr.c +++ b/misc/subr.c @@ -143,32 +143,6 @@ vfopen(FILE **ret, const char *mode, const char *fmt, ...) return err; } -int -canon_path(const char *path, char **res) -{ - char rp[PATH_MAX]; - - if (realpath(path, rp) == NULL) - return errno; -#if 0 - // This could be necessary on solaris. - if (rp[0] != '/') { - char wd[MAXPATHLEN]; - if (getcwd(wd, MAXPATHLEN) == NULL) - return errno; - if (strlcat(wd, "/", MAXPATHLEN) >= MAXPATHLEN) - return ENAMETOOLONG; - if (strlcat(wd, rp, MAXPATHLEN) >= MAXPATHLEN) - return ENAMETOOLONG; - strcpy(rp, wd); - } -#endif - if ((*res = strdup(rp)) == NULL) - return ENOMEM; - - return 0; -} - long rand_between(long min, long max) { diff --git a/misc/subr.h b/misc/subr.h index 0a6223a..1b9c90d 100644 --- a/misc/subr.h +++ b/misc/subr.h @@ -20,8 +20,6 @@ void set_bit(uint8_t *bits, unsigned long index); int has_bit(const uint8_t *bits, unsigned long index); void clear_bit(uint8_t *bits, unsigned long index); -int canon_path(const char *path, char **res); - long rand_between(long min, long max); int read_fully(int fd, void *buf, size_t len); |