@@ -143,32 +143,6 @@ vfopen(FILE **ret, const char *mode, const char *fmt, ...) | |||||
return err; | 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 | long | ||||
rand_between(long min, long max) | rand_between(long min, long max) | ||||
{ | { | ||||
@@ -20,8 +20,6 @@ void set_bit(uint8_t *bits, unsigned long index); | |||||
int has_bit(const 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); | void clear_bit(uint8_t *bits, unsigned long index); | ||||
int canon_path(const char *path, char **res); | |||||
long rand_between(long min, long max); | long rand_between(long min, long max); | ||||
int read_fully(int fd, void *buf, size_t len); | int read_fully(int fd, void *buf, size_t len); | ||||