When Lustre is configured with CFLAGS="-D_FORTIFY_SOURCE=2 -O2" on
Centos 6, the compilation will fails with errors such as this one:
cacheio.c: In function ‘qword_printhex’:
cacheio.c:174: error: ignoring return value of ‘fwrite’, declared
with attribute warn_unused_result
Signed-off-by: frank zago <fzago@cray.com>
Change-Id: Ie06fd5a26b62daf62bfd0133a2d7ebc66ece5be6
Reviewed-on: http://review.whamcloud.com/14126
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
rc = snprintf(cmd, sizeof(cmd), "rm -rf -- '%s'", mainpath);
ASSERTF(rc > 0 && rc < sizeof(cmd),
"invalid delete command for path '%s'", mainpath);
rc = snprintf(cmd, sizeof(cmd), "rm -rf -- '%s'", mainpath);
ASSERTF(rc > 0 && rc < sizeof(cmd),
"invalid delete command for path '%s'", mainpath);
+ rc = system(cmd);
+ ASSERTF(rc != -1, "Cannot execute rm command");
+ ASSERTF(WEXITSTATUS(rc) == 0,
+ "rm command returned %d", WEXITSTATUS(rc));
}
/* Helper - call path2fid, fd2fid and fid2path against an existing
}
/* Helper - call path2fid, fd2fid and fid2path against an existing
static char qword_buf[8192];
static char tmp_buf[8192];
static char qword_buf[8192];
static char tmp_buf[8192];
-void qword_print(FILE *f, char *str)
+int qword_print(FILE *f, char *str)
{
char *bp = qword_buf;
int len = sizeof(qword_buf);
{
char *bp = qword_buf;
int len = sizeof(qword_buf);
qword_add(&bp, &len, str);
qword_add(&bp, &len, str);
- fwrite(qword_buf, bp-qword_buf, 1, f);
+ sret = fwrite(qword_buf, bp-qword_buf, 1, f);
/* XXX: */
memcpy(tmp_buf, qword_buf, bp-qword_buf);
tmp_buf[bp-qword_buf] = '\0';
printerr(2, "%s", tmp_buf);
/* XXX: */
memcpy(tmp_buf, qword_buf, bp-qword_buf);
tmp_buf[bp-qword_buf] = '\0';
printerr(2, "%s", tmp_buf);
-void qword_printhex(FILE *f, char *str, int slen)
+int qword_printhex(FILE *f, char *str, int slen)
{
char *bp = qword_buf;
int len = sizeof(qword_buf);
{
char *bp = qword_buf;
int len = sizeof(qword_buf);
qword_addhex(&bp, &len, str, slen);
qword_addhex(&bp, &len, str, slen);
- fwrite(qword_buf, bp-qword_buf, 1, f);
+ sret = fwrite(qword_buf, bp-qword_buf, 1, f);
/* XXX: */
memcpy(tmp_buf, qword_buf, bp-qword_buf);
tmp_buf[bp-qword_buf] = '\0';
printerr(2, "%s", tmp_buf);
/* XXX: */
memcpy(tmp_buf, qword_buf, bp-qword_buf);
tmp_buf[bp-qword_buf] = '\0';
printerr(2, "%s", tmp_buf);
}
void qword_printint(FILE *f, int num)
}
void qword_printint(FILE *f, int num)
void qword_addint(char **bpp, int *lp, int n);
void qword_adduint(char **bpp, int *lp, unsigned int n);
void qword_addeol(char **bpp, int *lp);
void qword_addint(char **bpp, int *lp, int n);
void qword_adduint(char **bpp, int *lp, unsigned int n);
void qword_addeol(char **bpp, int *lp);
-void qword_print(FILE *f, char *str);
-void qword_printhex(FILE *f, char *str, int slen);
+int qword_print(FILE *f, char *str);
+int qword_printhex(FILE *f, char *str, int slen);
void qword_printint(FILE *f, int num);
int qword_eol(FILE *f);
int readline(int fd, char **buf, int *lenp);
void qword_printint(FILE *f, int num);
int qword_eol(FILE *f);
int readline(int fd, char **buf, int *lenp);
krb5_error_code code;
unsigned char constant_data[K5CLENGTH];
krb5_data datain;
krb5_error_code code;
unsigned char constant_data[K5CLENGTH];
krb5_data datain;
+ int keylength __attribute__ ((unused));
#ifdef HAVE_KRB5
void *enc;
#endif
#ifdef HAVE_KRB5
void *enc;
#endif
release_parent()
{
int status;
release_parent()
{
int status;
+ ssize_t sret __attribute__ ((unused));
- write(pipefds[1], &status, 1);
+ sret = write(pipefds[1], &status, 1);
close(pipefds[1]);
pipefds[1] = -1;
}
close(pipefds[1]);
pipefds[1] = -1;
}