Add support for null device numbers

They are resolved using the mountinfo interface and
mapping them to the block device listed there.
This commit is contained in:
Andrea Mazzoleni 2016-04-23 16:24:26 +02:00
parent cca81e7ff6
commit 4cc1109444
4 changed files with 237 additions and 61 deletions

View file

@ -586,6 +586,35 @@ char* polish(char* s)
return s;
}
unsigned split(char** split_map, unsigned split_max, char* str)
{
unsigned mac = 0;
/* skip initial spaces */
while (isspace(*str))
++str;
while (*str != 0 || mac == split_max) {
/* start of the token */
split_map[mac] = str;
++mac;
/* find the first separator or the end of the string */
while (*str != 0 && !isspace(*str))
++str;
/* put the final terminator if missing */
if (*str != 0)
*str++ = 0;
/* skip trailing spaces */
while (isspace(*str))
++str;
}
return mac;
}
/****************************************************************************/
/* path */