OSDN Git Service

Expand tabs on the rest of linux.c
authorPeter Jones <pjones@redhat.com>
Thu, 7 Jun 2018 17:47:43 +0000 (13:47 -0400)
committerPeter Jones <pmjones@gmail.com>
Fri, 8 Jun 2018 19:11:37 +0000 (15:11 -0400)
Signed-off-by: Peter Jones <pjones@redhat.com>
src/linux.c

index 80f2292..7d5fe16 100644 (file)
 int HIDDEN
 find_parent_devpath(const char * const child, char **parent)
 {
-       int ret;
-       char *node;
-       char *linkbuf;
-
-       /* strip leading /dev/ */
-       node = strrchr(child, '/');
-       if (!node)
-               return -1;
-       node++;
-
-       /* look up full path symlink */
-       ret = sysfs_readlink(&linkbuf, "class/block/%s", node);
-       if (ret < 0 || !linkbuf)
-               return ret;
-
-       /* strip child */
-       node = strrchr(linkbuf, '/');
-       if (!node)
-               return -1;
-       *node = '\0';
-
-       /* read parent */
-       node = strrchr(linkbuf, '/');
-       if (!node)
-               return -1;
-       *node = '\0';
-       node++;
-
-       /* write out new path */
-       ret = asprintf(parent, "/dev/%s", node);
-       if (ret < 0)
-               return ret;
-
-       return 0;
+        int ret;
+        char *node;
+        char *linkbuf;
+
+        /* strip leading /dev/ */
+        node = strrchr(child, '/');
+        if (!node)
+                return -1;
+        node++;
+
+        /* look up full path symlink */
+        ret = sysfs_readlink(&linkbuf, "class/block/%s", node);
+        if (ret < 0 || !linkbuf)
+                return ret;
+
+        /* strip child */
+        node = strrchr(linkbuf, '/');
+        if (!node)
+                return -1;
+        *node = '\0';
+
+        /* read parent */
+        node = strrchr(linkbuf, '/');
+        if (!node)
+                return -1;
+        *node = '\0';
+        node++;
+
+        /* write out new path */
+        ret = asprintf(parent, "/dev/%s", node);
+        if (ret < 0)
+                return ret;
+
+        return 0;
 }
 
 int HIDDEN