diff options
| author | Sachidananda <sac@gluster.com> | 2010-08-26 04:45:46 +0000 | 
|---|---|---|
| committer | Anand V. Avati <avati@dev.gluster.com> | 2010-08-26 07:31:06 -0700 | 
| commit | e1c52f630af0691872eff97e8156307a2964161c (patch) | |
| tree | 284d01f2610a476f169c470f9ffd72bcc07ee887 /glusterfsd/src | |
| parent | af7b57b3099d07be2469895e4c83e3fa4442777e (diff) | |
glusterfsd: Clang error fixes.
Signed-off-by: Sachidananda Urs <sac@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1077 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1077
Diffstat (limited to 'glusterfsd/src')
| -rw-r--r-- | glusterfsd/src/glusterfsd.c | 59 | 
1 files changed, 54 insertions, 5 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index c944075f7..bbdc551a6 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -226,29 +226,65 @@ create_fuse_mount (glusterfs_ctx_t *ctx)                  goto err;          } -        if (cmd_args->fuse_attribute_timeout >= 0) +        if (cmd_args->fuse_attribute_timeout >= 0) {                  ret = dict_set_double (master->options, ZR_ATTR_TIMEOUT_OPT,                                         cmd_args->fuse_attribute_timeout); -        if (cmd_args->fuse_entry_timeout >= 0) + +                if (ret < 0) { +                        gf_log ("glusterfsd", GF_LOG_ERROR, +                                "failed to set dict value."); +                        goto err; +                } +        } + +        if (cmd_args->fuse_entry_timeout >= 0) {                  ret = dict_set_double (master->options, ZR_ENTRY_TIMEOUT_OPT,                                         cmd_args->fuse_entry_timeout); +                if (ret < 0) { +                        gf_log ("glusterfsd", GF_LOG_ERROR, +                                "failed to set dict value."); +                        goto err; +                } +        } -        if (cmd_args->volfile_check) +        if (cmd_args->volfile_check) {                  ret = dict_set_int32 (master->options, ZR_STRICT_VOLFILE_CHECK,                                        cmd_args->volfile_check); +                if (ret < 0) { +                        gf_log ("glusterfsd", GF_LOG_ERROR, +                                "failed to set dict value."); +                        goto err; +                } +        } -        if (cmd_args->dump_fuse) +        if (cmd_args->dump_fuse) {                  ret = dict_set_static_ptr (master->options, ZR_DUMP_FUSE,                                             cmd_args->dump_fuse); +                if (ret < 0) { +                        gf_log ("glusterfsd", GF_LOG_ERROR, +                                "failed to set dict value."); +                        goto err; +                } +        }          switch (cmd_args->fuse_direct_io_mode) {          case GF_OPTION_DISABLE: /* disable */                  ret = dict_set_static_ptr (master->options, ZR_DIRECT_IO_OPT,                                             "disable"); +                if (ret < 0) { +                        gf_log ("glusterfsd", GF_LOG_ERROR, +                                "failed to set dict value."); +                        goto err; +                }                  break;          case GF_OPTION_ENABLE: /* enable */                  ret = dict_set_static_ptr (master->options, ZR_DIRECT_IO_OPT,                                             "enable"); +                if (ret < 0) { +                        gf_log ("glusterfsd", GF_LOG_ERROR, +                                "failed to set dict value."); +                        goto err; +                }                  break;          case GF_OPTION_DEFERRED: /* default */          default: @@ -638,7 +674,9 @@ reincarnate (int signum)          if (!cmd_args->volfile_server)                  ret = glusterfs_volumes_init (ctx); - +        if (ret < 0) +                gf_log ("glusterfsd", GF_LOG_ERROR, +                        "volume initialization failed.");          return;  } @@ -984,6 +1022,12 @@ glusterfs_pidfile_setup (glusterfs_ctx_t *ctx)                  cmd_args->pid_file);          ret = lockf (fileno (pidfp), F_ULOCK, 0); +        if (ret) { +                gf_log ("glusterfsd", GF_LOG_ERROR, +                        "pidfile %s unlock error (%s)", +                        cmd_args->pid_file, strerror (errno)); +                return ret; +        }          ctx->pidfp = pidfp; @@ -1184,6 +1228,11 @@ daemonize (glusterfs_ctx_t *ctx)                  goto postfork;          ret = os_daemon (0, 0); +        if (ret == -1) { +                gf_log ("daemonize", GF_LOG_ERROR, +                        "Daemonization failed: %s", strerror(errno)); +                return ret; +        }  postfork:          ret = glusterfs_pidfile_update (ctx);  | 
