diff --git a/daemon/idmap.c b/daemon/idmap.c index 830760e..f59559a 100644 --- a/daemon/idmap.c +++ b/daemon/idmap.c @@ -91,7 +91,7 @@ struct idmap_config { char base[VAL_LEN]; /* caching configuration */ - UINT cache_ttl; + INT cache_ttl; }; @@ -597,7 +597,7 @@ static int idmap_query_attrs( const unsigned attributes, const unsigned optional, PCHAR *values[], - const size_t len) + const int len) { char filter[FILTER_LEN]; struct idmap_config *config = &context->config; diff --git a/daemon/nfs41_client.c b/daemon/nfs41_client.c index 898a483..34d1dc7 100644 --- a/daemon/nfs41_client.c +++ b/daemon/nfs41_client.c @@ -184,8 +184,7 @@ static int getdomainname(char *domain) if (status) dprintf(1, "getnameinfo failed %d\n", WSAGetLastError()); else { - int i = 0; - size_t len = strlen(hostname); + size_t i, len = strlen(hostname); char *p = hostname; dprintf(1, "getdomainname: hostname %s %d\n", hostname, len); for(i = 0; i < len; i++) diff --git a/daemon/nfs41_ops.c b/daemon/nfs41_ops.c index b114c83..455d4ef 100644 --- a/daemon/nfs41_ops.c +++ b/daemon/nfs41_ops.c @@ -128,7 +128,7 @@ int nfs41_create_session(nfs41_client *clnt, nfs41_session *session, bool_t try_ req.csa_cb_secparams[0].type = 0; /* AUTH_NONE */ req.csa_cb_secparams[1].type = 1; /* AUTH_SYS */ req.csa_cb_secparams[1].u.auth_sys.machinename = clnt->rpc->server_name; - req.csa_cb_secparams[1].u.auth_sys.stamp = time(NULL); + req.csa_cb_secparams[1].u.auth_sys.stamp = (uint32_t)time(NULL); // ca_maxrequests should be gotten from the rpc layer set_fore_channel_attrs(clnt->rpc, @@ -419,6 +419,7 @@ int nfs41_open( case CLAIM_FH: case CLAIM_DELEG_CUR_FH: case CLAIM_DELEG_PREV_FH: + default: /* CURRENT_FH: file being opened */ current_fh_is_dir = FALSE; /* SEQUENCE; PUTFH(file); OPEN; GETATTR(file); PUTFH(dir); GETATTR */ @@ -708,7 +709,7 @@ int nfs41_write( nfs41_getattr_args getattr_args; nfs41_getattr_res getattr_res = {0}; bitmap4 attr_request; - nfs41_file_info info; + nfs41_file_info info = { 0 }; init_getattr_request(&attr_request); diff --git a/daemon/nfs41_xdr.c b/daemon/nfs41_xdr.c index 6e2513c..81a1a7b 100644 --- a/daemon/nfs41_xdr.c +++ b/daemon/nfs41_xdr.c @@ -2604,7 +2604,7 @@ static bool_t encode_file_attrs( } if (info->attrmask.arr[1] & FATTR4_WORD1_OWNER) { char *ptr = &info->owner[0]; - uint32_t owner_len = strlen(info->owner); + uint32_t owner_len = (uint32_t)strlen(info->owner); if (!xdr_bytes(&localxdr, &ptr, &owner_len, NFS4_OPAQUE_LIMIT)) return FALSE; @@ -2612,7 +2612,7 @@ static bool_t encode_file_attrs( } if (info->attrmask.arr[1] & FATTR4_WORD1_OWNER_GROUP) { char *ptr = &info->owner_group[0]; - uint32_t owner_group_len = strlen(info->owner_group); + uint32_t owner_group_len = (uint32_t)strlen(info->owner_group); if (!xdr_bytes(&localxdr, &ptr, &owner_group_len, NFS4_OPAQUE_LIMIT)) return FALSE; diff --git a/daemon/recovery.c b/daemon/recovery.c index 0507f52..56c403b 100644 --- a/daemon/recovery.c +++ b/daemon/recovery.c @@ -143,7 +143,7 @@ static int recover_open( IN OUT bool_t *grace) { open_delegation4 delegation = { 0 }; - stateid4 stateid; + stateid4 stateid = { 0 }; enum open_delegation_type4 delegate_type = OPEN_DELEGATE_NONE; int status = NFS4ERR_BADHANDLE; diff --git a/daemon/service.c b/daemon/service.c index af3a819..5d98983 100644 --- a/daemon/service.c +++ b/daemon/service.c @@ -264,11 +264,9 @@ BOOL ReportStatusToSCMgr(DWORD dwCurrentState, // Report the status of the service to the service control manager. - // - if (!(fResult = SetServiceStatus( sshStatusHandle, &ssStatus))) - { + fResult = SetServiceStatus(sshStatusHandle, &ssStatus); + if (!fResult) AddToMessageLog(TEXT("SetServiceStatus")); - } } return fResult; }