Fixed compile time warnings with configure --disable-xattr --disable-libac.

Instigated by Coverity CID 12543.
This commit is contained in:
Thomas Schmitt 2015-10-13 14:28:34 +02:00
parent 6047464b6b
commit 57fd669d1d

View File

@ -186,16 +186,20 @@ int aaip_get_attr_list(char *path, size_t *num_attrs, char ***names,
size_t **value_lengths, char ***values, int flag) size_t **value_lengths, char ***values, int flag)
{ {
int ret; int ret;
ssize_t i, num_names= 0;
#ifdef Libisofs_with_aaip_acL #ifdef Libisofs_with_aaip_acL
unsigned char *acl= NULL; unsigned char *acl= NULL;
char *a_acl_text= NULL, *d_acl_text= NULL; char *a_acl_text= NULL, *d_acl_text= NULL;
size_t acl_len= 0; size_t acl_len= 0;
#define Libisofs_aaip_get_attr_activE yes
#endif #endif
#ifdef Libisofs_with_aaip_xattR #ifdef Libisofs_with_aaip_xattR
char *list= NULL; char *list= NULL;
ssize_t value_ret, retry= 0, list_size= 0; ssize_t value_ret, retry= 0, list_size= 0;
#define Libisofs_aaip_get_attr_activE yes
#endif
#ifdef Libisofs_aaip_get_attr_activE
ssize_t i, num_names= 0;
#endif #endif
if(flag & (1 << 15)) { /* Free memory */ if(flag & (1 << 15)) { /* Free memory */
@ -207,6 +211,14 @@ int aaip_get_attr_list(char *path, size_t *num_attrs, char ***names,
*value_lengths= NULL; *value_lengths= NULL;
*values= NULL; *values= NULL;
#ifndef Libisofs_aaip_get_attr_activE
ret = 1;
ex:;
return ret;
#else /* Libisofs_aaip_get_attr_activE */
/* Set up arrays */ /* Set up arrays */
#ifdef Libisofs_with_aaip_xattR #ifdef Libisofs_with_aaip_xattR
@ -361,6 +373,9 @@ ex:;
*num_attrs= 0; *num_attrs= 0;
} }
return(ret); return(ret);
#endif /* Libisofs_aaip_get_attr_activE */
} }
@ -444,12 +459,17 @@ ex:
int aaip_set_attr_list(char *path, size_t num_attrs, char **names, int aaip_set_attr_list(char *path, size_t num_attrs, char **names,
size_t *value_lengths, char **values, int flag) size_t *value_lengths, char **values, int flag)
{ {
int ret, has_default_acl= 0; int ret;
size_t i, consumed, acl_text_fill, acl_idx= 0, h_consumed; size_t i, consumed, acl_text_fill, acl_idx= 0;
char *acl_text= NULL, *list= NULL; char *acl_text= NULL, *list= NULL;
#ifdef Libisofs_with_aaip_xattR #ifdef Libisofs_with_aaip_xattR
ssize_t list_size= 0; ssize_t list_size= 0;
#endif #endif
#ifdef Libisofs_with_aaip_acL
size_t h_consumed;
int has_default_acl= 0;
#endif
#ifdef Libisofs_with_aaip_xattR #ifdef Libisofs_with_aaip_xattR
@ -539,10 +559,11 @@ int aaip_set_attr_list(char *path, size_t num_attrs, char **names,
goto ex; goto ex;
if(ret <= 0) if(ret <= 0)
{ret= -2; goto ex;} {ret= -2; goto ex;}
has_default_acl= (ret == 2);
#ifdef Libisofs_with_aaip_acL #ifdef Libisofs_with_aaip_acL
has_default_acl= (ret == 2);
ret= aaip_set_acl_text(path, acl_text, flag & 32); ret= aaip_set_acl_text(path, acl_text, flag & 32);
if(ret <= 0) if(ret <= 0)
{ret= -3; goto ex;} {ret= -3; goto ex;}