9
0
Fork 0

fix bug in ramfs when creating files whose parents do not exist

This commit is contained in:
Sascha Hauer 2007-09-27 11:58:22 +02:00
parent 06efc2b81a
commit 2d02f7c0f0
1 changed files with 5 additions and 2 deletions

View File

@ -216,8 +216,11 @@ int ramfs_create(struct device_d *dev, const char *pathname, mode_t mode)
char *file;
node = rlookup_parent(priv, pathname, &file);
node_insert(node, file, mode);
return 0;
if (node) {
node_insert(node, file, mode);
return 0;
}
return -ENOENT;
}
int ramfs_unlink(struct device_d *dev, const char *pathname)