mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-03 21:30:14 -05:00
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:
parent
cca81e7ff6
commit
4cc1109444
4 changed files with 237 additions and 61 deletions
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue