The major:minor read from dev ends with \n, need to trim that.
authorRob Landley <rob@landley.net>
Thu, 12 Jan 2006 03:07:49 +0000 (03:07 -0000)
committerRob Landley <rob@landley.net>
Thu, 12 Jan 2006 03:07:49 +0000 (03:07 -0000)
util-linux/mdev.c

index d414c0c1033aa8651327a0d8cacb15281ea006f7..10369ded37bcbba0345abf3da9c69505f9513f8c 100644 (file)
@@ -42,7 +42,7 @@ static void make_device(char *path)
        fd = open(temp, O_RDONLY);
        len = read(fd, temp, PATH_MAX-1);
        if (len<1) goto end;
-       temp[len] = 0;
+       temp[--len] = 0; // remove trailing \n
        close(fd);
        
        /* Determine device name, type, major and minor */