Skip to content

Commit

Permalink
Removed unused dirlookup argument in create
Browse files Browse the repository at this point in the history
The `off` argument to `dirlookup` is optional.  It
was not being used in the `dirlookup` call in `create`,
so pass NULL instead and delete the unused local.

Signed-off-by: Dan Cross <[email protected]>
  • Loading branch information
Dan Cross authored and kaashoek committed Aug 19, 2019
1 parent b818915 commit 0581c37
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sysfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,14 @@ sys_unlink(void)
static struct inode*
create(char *path, short type, short major, short minor)
{
uint off;
struct inode *ip, *dp;
char name[DIRSIZ];

if((dp = nameiparent(path, name)) == 0)
return 0;
ilock(dp);

if((ip = dirlookup(dp, name, &off)) != 0){
if((ip = dirlookup(dp, name, 0)) != 0){
iunlockput(dp);
ilock(ip);
if(type == T_FILE && ip->type == T_FILE)
Expand Down

0 comments on commit 0581c37

Please sign in to comment.