From 173fc51539683030178a8f833281c787b1933ffd Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Tue, 14 Jun 2005 06:37:57 +0000 Subject: Add device files created with --auto to list of known device files. Signed-off-by: Neil Brown --- util.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'util.c') diff --git a/util.c b/util.c index f3f6446..4445b16 100644 --- a/util.c +++ b/util.c @@ -313,6 +313,9 @@ struct devmap { int devlist_ready = 0; #ifdef UCLIBC +int add_dev(const char *name, const struct stat *stb, int flag, struct FTW *s) +{ +} char *map_dev(int major, int minor) { #if 0 @@ -322,15 +325,19 @@ char *map_dev(int major, int minor) return NULL; } #else -#define __USE_XOPEN_EXTENDED -#include +#ifdef __dietlibc__ +int add_dev_1(const char *name, const struct stat *stb, int flag) +{ + return add_dev(name, stb, flag, NULL); +} +int nftw(const char *path, int (*han)(const char *name, const struct stat *stb, int flag, struct FTW *s), int nopenfd, int flags) +{ + ftw(path, add_dev_1, nopenfd); +} +#endif -#ifndef __dietlibc__ int add_dev(const char *name, const struct stat *stb, int flag, struct FTW *s) -#else -int add_dev(const char *name, const struct stat *stb, int flag) -#endif { if ((stb->st_mode&S_IFMT)== S_IFBLK) { char *n = strdup(name); @@ -358,11 +365,7 @@ char *map_dev(int major, int minor) struct devmap *p; char *std = NULL, *nonstd=NULL; if (!devlist_ready) { -#ifndef __dietlibc__ nftw("/dev", add_dev, 10, FTW_PHYS); -#else - ftw("/dev", add_dev, 10); -#endif devlist_ready=1; } -- cgit