.B \-r
Print the
.B udev_root
-directory. When used in conjunction with a query for the node name, the
+directory. When used in conjunction with a query for the node name or the
+symlink names, the
.B udev_root
-will be prepended.
+will be prepended to query result.
.TP
.BI \-q " query_type"
Query the database for specified value of a created device node or network
int root = 0;
int attributes = 0;
enum query_type query = NONE;
- char result[NAME_SIZE] = "";
+ char result[1024] = "";
char path[NAME_SIZE] = "";
char name[NAME_SIZE] = "";
char temp[NAME_SIZE];
break;
case SYMLINK:
- strfieldcpy(result, udev.symlink);
+ if (root) {
+ int slen;
+ char *spos;
+ char slink[NAME_SIZE];
+
+ pos = result;
+ foreach_strpart(udev.symlink, " \n\r", spos, slen) {
+ strncpy(slink, spos, slen);
+ slink[slen] = '\0';
+ pos += sprintf(pos, "%s/%s ", udev_root, slink);
+ }
+ } else {
+ strfieldcpy(result, udev.symlink);
+ }
break;
case PATH: