diff options
author | Roland McGrath <roland@gnu.org> | 2001-04-15 22:44:03 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2001-04-15 22:44:03 +0000 |
commit | 47f271bfc6b7a6ba1229fd1dfc6870e6fa135825 (patch) | |
tree | 1a357bd28d07d4b6eed2cad4404cd63d1e426c9b /libdiskfs | |
parent | 3384a3518bf61eac985d8715881f5e19b36464c3 (diff) |
2001-04-14 Neal H Walfield <neal@cs.uml.edu>
* node-create.c (diskfs_create_node): If we fail, set *NEWNODE
to NULL; at least diskfs_S_dir_lookup depends on this behavior.
Diffstat (limited to 'libdiskfs')
-rw-r--r-- | libdiskfs/node-create.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libdiskfs/node-create.c b/libdiskfs/node-create.c index 09dc4a5a..7cbdade1 100644 --- a/libdiskfs/node-create.c +++ b/libdiskfs/node-create.c @@ -1,5 +1,5 @@ /* Making new files - Copyright (C) 1992, 1993, 1994, 1996, 1998 Free Software Foundation + Copyright (C) 1992,93,94,96,98,2001 Free Software Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -38,7 +38,10 @@ diskfs_create_node (struct node *dir, gid_t newgid; if (diskfs_check_readonly ()) - return EROFS; + { + *newnode = NULL; + return EROFS; + } /* Make the node */ err = diskfs_alloc_node (dir, mode, newnode); @@ -46,6 +49,7 @@ diskfs_create_node (struct node *dir, { if (name) diskfs_drop_dirstat (dir, ds); + *newnode = NULL; return err; } @@ -100,6 +104,7 @@ diskfs_create_node (struct node *dir, np->dn_stat.st_nlink = 0; if (name) diskfs_drop_dirstat (dir, ds); + *newnode = NULL; return err; } @@ -115,5 +120,8 @@ diskfs_create_node (struct node *dir, diskfs_nput (np); } } + if (err) + *newnode = NULL; + return err; } |