chiark / gitweb /
[PATCH] switch device type to enum
[elogind.git] / udev_utils.c
index ca46258def32d2059430c9f75f04586886f7f312..e6580d2c0acdca0404e17b2cddb1eee19ec0ad6d 100644 (file)
@@ -47,15 +47,15 @@ void udev_init_device(struct udevice *udev, const char* devpath, const char *sub
                strfieldcpy(udev->subsystem, subsystem);
 
        if (strcmp(udev->subsystem, "block") == 0)
-               udev->type = 'b';
+               udev->type = BLOCK;
        else if (strcmp(udev->subsystem, "net") == 0)
-               udev->type = 'n';
+               udev->type = NET;
        else if (strncmp(udev->devpath, "/block/", 7) == 0)
-               udev->type = 'b';
+               udev->type = BLOCK;
        else if (strncmp(udev->devpath, "/class/net/", 11) == 0)
-               udev->type = 'n';
+               udev->type = NET;
        else if (strncmp(udev->devpath, "/class/", 7) == 0)
-               udev->type = 'c';
+               udev->type = CLASS;
 
        udev->mode = 0660;
        strcpy(udev->owner, "root");
@@ -113,7 +113,7 @@ int create_path(const char *path)
 }
 
 /* Reset permissions on the device node, before unlinking it to make sure,
- * that permisions of possible hard links will be removed to.
+ * that permisions of possible hard links will be removed too.
  */
 int unlink_secure(const char *filename)
 {