Browse Source

Remove unused function canon_path.

master
Richard Nyberg 19 years ago
parent
commit
8d05b64fa1
2 changed files with 0 additions and 28 deletions
  1. +0
    -26
      misc/subr.c
  2. +0
    -2
      misc/subr.h

+ 0
- 26
misc/subr.c View File

@@ -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)
{ {


+ 0
- 2
misc/subr.h View File

@@ -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);


Loading…
Cancel
Save