Mirror of git://git.busybox.net/busybox with our patches on top
Source
xxxxxxxxxx
static void scan_dir(char *dir_name, dev_t devno, struct dir_list **list,
/* vi: set sw=4 ts=4: */
/*
* devno.c - find a particular device by its device number (major/minor)
*
* Copyright (C) 2000, 2001, 2003 Theodore Ts'o
* Copyright (C) 2001 Andreas Dilger
*
* %Begin-Header%
* This file may be redistributed under the terms of the
* GNU Lesser General Public License.
* %End-Header%
*/
struct dir_list {
char *name;
struct dir_list *next;
};
char *blkid_strndup(const char *s, int length)
{
char *ret;
if (!s)
return NULL;
if (!length)
length = strlen(s);
ret = xmalloc(length + 1);
strncpy(ret, s, length);
ret[length] = '\0';
return ret;
}
char *blkid_strdup(const char *s)
{
return blkid_strndup(s, 0);
}
/*
* This function adds an entry to the directory list
*/