Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 3f3e5b5 in mainline


Ignore:
Timestamp:
2011-07-07T18:07:31Z (10 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master
Children:
367d67fe
Parents:
b89281b
Message:

The first two dentries (dot and dotdot) must be ignored from the mfs_has_children() function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/minixfs/mfs_ops.c

    rb89281b r3f3e5b5  
    539539        r = mfs_has_children(&has_children, cfn);
    540540        on_error(r, return r);
     541
    541542        if (has_children)
    542543                return ENOTEMPTY;
     
    570571        /* The first two dentries are always . and .. */
    571572        unsigned i;
    572         for (i = 0; i < mnode->ino_i->i_size / sbi->dirsize; ++i) {
     573        for (i = 2; i < mnode->ino_i->i_size / sbi->dirsize; ++i) {
    573574                r = read_directory_entry(mnode, &d_info, i);
    574575                on_error(r, return r);
     
    623624                struct mfs_sb_info *sbi = mnode->instance->sbi;
    624625
    625                 unsigned i;
    626                 for (i = pos; i < mnode->ino_i->i_size / sbi->dirsize; ++i) {
     626                for (; pos < mnode->ino_i->i_size / sbi->dirsize; ++pos) {
    627627                        rc = read_directory_entry(mnode, &d_info, pos);
    628628                        on_error(rc, goto out_error);
     
    632632                                goto found;
    633633                        }
    634                         pos++;
    635634                }
    636635
Note: See TracChangeset for help on using the changeset viewer.