Changeset 904 in MondoRescue for trunk/mindi-busybox/util-linux/mdev.c


Ignore:
Timestamp:
Oct 25, 2006, 1:51:57 AM (17 years ago)
Author:
Bruno Cornec
Message:

merge -r890:902 $SVN_M/branches/stable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mindi-busybox/util-linux/mdev.c

    r821 r904  
    4141     * also depend on path having writeable space after it. */
    4242
    43     strcat(path, "/dev");
    44     fd = open(path, O_RDONLY);
    45     len = read(fd, temp + 1, 64);
    46     *temp++ = 0;
    47     close(fd);
    48     if (len < 1) return;
     43    if (!delete) {
     44        strcat(path, "/dev");
     45        fd = open(path, O_RDONLY);
     46        len = read(fd, temp + 1, 64);
     47        *temp++ = 0;
     48        close(fd);
     49        if (len < 1) return;
     50    }
    4951
    5052    /* Determine device name, type, major and minor */
     
    5254    device_name = strrchr(path, '/') + 1;
    5355    type = path[5]=='c' ? S_IFCHR : S_IFBLK;
    54     if (sscanf(temp, "%d:%d", &major, &minor) != 2) return;
    5556
    5657    /* If we have a config file, look up permissions for this device */
     
    168169    umask(0);
    169170    if (!delete) {
     171        if (sscanf(temp, "%d:%d", &major, &minor) != 2) return;
    170172        if (mknod(device_name, mode | type, makedev(major, minor)) && errno != EEXIST)
    171173            bb_perror_msg_and_die("mknod %s failed", device_name);
Note: See TracChangeset for help on using the changeset viewer.