summaryrefslogtreecommitdiff
path: root/mount.cifs.c
diff options
context:
space:
mode:
authorSuresh Jayaraman <sjayaraman@suse.de>2010-08-04 07:55:54 -0400
committerJeff Layton <jlayton@samba.org>2010-08-04 07:55:54 -0400
commit2b2ce5830fec4317e0c264115cf93e64344b1417 (patch)
tree9b9467ac258de052f2271850482ecaabaad02beb /mount.cifs.c
parent796c714569f5a2d1563f284d94333f2971217417 (diff)
downloadcifs-utils-2b2ce5830fec4317e0c264115cf93e64344b1417.tar.gz
cifs-utils-2b2ce5830fec4317e0c264115cf93e64344b1417.tar.bz2
cifs-utils-2b2ce5830fec4317e0c264115cf93e64344b1417.zip
mount.cifs: remove redundant error assignment
Avoid setting error code twice by moving error handling out of add_mtab_exit block. We already set error code and report error in other places. Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
Diffstat (limited to 'mount.cifs.c')
-rw-r--r--mount.cifs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mount.cifs.c b/mount.cifs.c
index 9f04261..3623e76 100644
--- a/mount.cifs.c
+++ b/mount.cifs.c
@@ -1554,16 +1554,16 @@ add_mtab(char *devname, char *mountpoint, unsigned long flags, const char *fstyp
mountent.mnt_freq = 0;
mountent.mnt_passno = 0;
rc = addmntent(pmntfile, &mountent);
+ if (rc) {
+ fprintf(stderr, "unable to add mount entry to mtab\n");
+ rc = EX_FILEIO;
+ }
endmntent(pmntfile);
unlock_mtab();
SAFE_FREE(mountent.mnt_opts);
add_mtab_exit:
toggle_dac_capability(1, 0);
sigprocmask(SIG_SETMASK, &oldmask, NULL);
- if (rc) {
- fprintf(stderr, "unable to add mount entry to mtab\n");
- rc = EX_FILEIO;
- }
return rc;
}