]> wimlib.net Git - wimlib/blobdiff - src/dentry.c
Get rid of static variables in mount.c
[wimlib] / src / dentry.c
index beb963d2c839f96517aac79b8ad3f9259db74270..39505b756c81118f5927b70ab2e7728db3cebe38 100644 (file)
@@ -457,10 +457,10 @@ struct inode *wim_pathname_to_inode(WIMStruct *w, const char *path)
 {
        struct dentry *dentry;
        dentry = get_dentry(w, path);
 {
        struct dentry *dentry;
        dentry = get_dentry(w, path);
-       if (!dentry)
-               return NULL;
-       else
+       if (dentry)
                return dentry->d_inode;
                return dentry->d_inode;
+       else
+               return NULL;
 }
 
 /* Returns the dentry that corresponds to the parent directory of @path, or NULL
 }
 
 /* Returns the dentry that corresponds to the parent directory of @path, or NULL
@@ -953,19 +953,19 @@ int verify_dentry(struct dentry *dentry, void *wim)
 {
        const WIMStruct *w = wim;
        const struct inode *inode = dentry->d_inode;
 {
        const WIMStruct *w = wim;
        const struct inode *inode = dentry->d_inode;
-       int ret = WIMLIB_ERR_INVALID_DENTRY;
+       int ret;
 
        if (!dentry->d_inode->verified) {
                ret = verify_inode(dentry->d_inode, w);
                if (ret != 0)
 
        if (!dentry->d_inode->verified) {
                ret = verify_inode(dentry->d_inode, w);
                if (ret != 0)
-                       goto out;
+                       return ret;
        }
 
        /* Cannot have a short name but no long name */
        if (dentry->short_name_len && !dentry->file_name_len) {
                ERROR("Dentry `%s' has a short name but no long name",
                      dentry->full_path_utf8);
        }
 
        /* Cannot have a short name but no long name */
        if (dentry->short_name_len && !dentry->file_name_len) {
                ERROR("Dentry `%s' has a short name but no long name",
                      dentry->full_path_utf8);
-               goto out;
+               return WIMLIB_ERR_INVALID_DENTRY;
        }
 
        /* Make sure root dentry is unnamed */
        }
 
        /* Make sure root dentry is unnamed */
@@ -973,7 +973,7 @@ int verify_dentry(struct dentry *dentry, void *wim)
                if (dentry->file_name_len) {
                        ERROR("The root dentry is named `%s', but it must "
                              "be unnamed", dentry->file_name_utf8);
                if (dentry->file_name_len) {
                        ERROR("The root dentry is named `%s', but it must "
                              "be unnamed", dentry->file_name_utf8);
-                       goto out;
+                       return WIMLIB_ERR_INVALID_DENTRY;
                }
        }
 
                }
        }
 
@@ -986,9 +986,7 @@ int verify_dentry(struct dentry *dentry, void *wim)
        }
 #endif
 
        }
 #endif
 
-       ret = 0;
-out:
-       return ret;
+       return 0;
 }
 
 
 }