aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libshare
diff options
context:
space:
mode:
authorcao <[email protected]>2016-11-01 07:56:10 +0800
committerBrian Behlendorf <[email protected]>2016-10-31 16:56:10 -0700
commit2bac68145f94012d6e41dffb9f4a7faf80a8e107 (patch)
treeac5d389e14e19d98de0821f2054ddb3115b719c0 /lib/libshare
parentb182ac00aa60d1b61d92d70ea399cd39f966fb31 (diff)
Fix coverity defects: CID 147548
CID 147548: Type:Dereference null return value Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: cao.xuewen <[email protected]> Closes #5321
Diffstat (limited to 'lib/libshare')
-rw-r--r--lib/libshare/libshare.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libshare/libshare.c b/lib/libshare/libshare.c
index 89a4fe9aa..0eb4ae00d 100644
--- a/lib/libshare/libshare.c
+++ b/lib/libshare/libshare.c
@@ -113,7 +113,7 @@ parse_sharetab(sa_handle_impl_t impl_handle) {
char line[512];
char *eol, *pathname, *resource, *fstype, *options, *description;
- fp = fopen("/etc/dfs/sharetab", "r");
+ fp = fopen(ZFS_SHARETAB, "r");
if (fp == NULL)
return;
@@ -170,7 +170,7 @@ update_sharetab(sa_handle_impl_t impl_handle)
sa_share_impl_t impl_share;
int temp_fd;
FILE *temp_fp;
- char tempfile[] = "/etc/dfs/sharetab.XXXXXX";
+ char tempfile[] = ZFS_SHARETAB".XXXXXX";
sa_fstype_t *fstype;
const char *resource;
@@ -215,7 +215,7 @@ update_sharetab(sa_handle_impl_t impl_handle)
fsync(temp_fd);
fclose(temp_fp);
- (void) rename(tempfile, "/etc/dfs/sharetab");
+ (void) rename(tempfile, ZFS_SHARETAB);
}
typedef struct update_cookie_s {