From 2b2ce5830fec4317e0c264115cf93e64344b1417 Mon Sep 17 00:00:00 2001 From: Suresh Jayaraman Date: Wed, 4 Aug 2010 07:55:54 -0400 Subject: 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 --- mount.cifs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mount.cifs.c') 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; } -- cgit v1.2.3