mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
Fix some compile warnings on RHEL5
- returned char not needed to be explicitly const - warn if pipe() fails in clvmd (more fixes here needed for error paths...) - assign (and ignore) read() output in drain buffer
This commit is contained in:
parent
0cb777d642
commit
cbedb99e4c
@ -1007,7 +1007,10 @@ static void be_daemon(int timeout)
|
||||
exit(3);
|
||||
}
|
||||
|
||||
pipe(child_pipe);
|
||||
if (pipe(child_pipe)) {
|
||||
perror("Error creating pipe");
|
||||
exit(3);
|
||||
}
|
||||
|
||||
switch (fork()) {
|
||||
case -1:
|
||||
@ -1254,7 +1257,9 @@ static int read_from_local_sock(struct local_client *thisfd)
|
||||
}
|
||||
|
||||
/* Create a pipe and add the reading end to our FD list */
|
||||
pipe(comms_pipe);
|
||||
if (pipe(comms_pipe))
|
||||
DEBUGLOG("creating pipe failed: %s\n", strerror(errno));
|
||||
|
||||
newfd = malloc(sizeof(struct local_client));
|
||||
if (!newfd) {
|
||||
struct clvm_header reply;
|
||||
|
@ -309,7 +309,7 @@ static int _daemon_write(struct dm_event_fifos *fifos,
|
||||
}
|
||||
if (ret == 0)
|
||||
break;
|
||||
read(fifos->server, drainbuf, 127);
|
||||
ret = read(fifos->server, drainbuf, 127);
|
||||
}
|
||||
|
||||
while (bytes < size) {
|
||||
|
@ -131,7 +131,7 @@ uint64_t units_to_bytes(const char *units, char *unit_type)
|
||||
return v * multiplier;
|
||||
}
|
||||
|
||||
const char alloc_policy_char(alloc_policy_t alloc)
|
||||
char alloc_policy_char(alloc_policy_t alloc)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -57,7 +57,7 @@ void display_segtypes(const struct cmd_context *cmd);
|
||||
* Allocation policy display conversion routines.
|
||||
*/
|
||||
const char *get_alloc_string(alloc_policy_t alloc);
|
||||
const char alloc_policy_char(alloc_policy_t alloc);
|
||||
char alloc_policy_char(alloc_policy_t alloc);
|
||||
alloc_policy_t get_alloc_from_string(const char *str);
|
||||
|
||||
char yes_no_prompt(const char *prompt, ...) __attribute__ ((format(printf, 1, 2)));
|
||||
|
Loading…
Reference in New Issue
Block a user