version 1.22, 2007/09/17 08:36:57 |
version 1.23, 2007/09/17 09:28:36 |
|
|
|
|
/* find the inode of root */ |
/* find the inode of root */ |
if (stat("/", &st_root) == -1) { |
if (stat("/", &st_root) == -1) { |
(void)snprintf(pathname, MAXPATHLEN, |
(void)snprintf(pathname, MAXPATHLEN, |
"getwd: Cannot stat \"/\" (%s)", strerror(errno)); |
"getwd: Cannot stat \"/\" (%s)", strerror(errno)); |
return NULL; |
return NULL; |
} |
} |
|
|
for (d = readdir(dp); d != NULL; d = readdir(dp)) { |
for (d = readdir(dp); d != NULL; d = readdir(dp)) { |
if (ISDOT(d->d_name) || ISDOTDOT(d->d_name)) |
if (ISDOT(d->d_name) || ISDOTDOT(d->d_name)) |
continue; |
continue; |
(void)strlcpy(cur_name_add, d->d_name, |
(void)strlcpy(cur_name_add, d->d_name, |
sizeof(nextpathbuf) MAXPATHLEN - (MAXPATHLEN - 1)); |
sizeof(nextpathbuf) MAXPATHLEN - (MAXPATHLEN - 1)); |
if (lstat(nextpathptr, &st_next) == -1) { |
if (lstat(nextpathptr, &st_next) == -1) { |
(void)snprintf(pathname, MAXPATHLEN, |
(void)snprintf(pathname, MAXPATHLEN, |