1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

A bit more readable code

Just a minor readability conversion.
This commit is contained in:
Zdenek Kabelac 2012-02-08 13:03:40 +00:00
parent 94f88a4f14
commit cdcf7aaf07

View File

@ -741,8 +741,7 @@ static int local_pipe_callback(struct local_client *thisfd, char *buf,
status, sock_client); status, sock_client);
/* But has the client gone away ?? */ /* But has the client gone away ?? */
if (sock_client == NULL) { if (sock_client == NULL) {
DEBUGLOG DEBUGLOG("Got PIPE response for dead client, ignoring it\n");
("Got PIPE response for dead client, ignoring it\n");
} else { } else {
/* If error then just return that code */ /* If error then just return that code */
if (status) if (status)
@ -751,21 +750,16 @@ static int local_pipe_callback(struct local_client *thisfd, char *buf,
else { else {
/* FIXME: closer inspect this code since state is write thread protected */ /* FIXME: closer inspect this code since state is write thread protected */
pthread_mutex_lock(&sock_client->bits.localsock.mutex); pthread_mutex_lock(&sock_client->bits.localsock.mutex);
if (sock_client->bits.localsock.state == if (sock_client->bits.localsock.state == POST_COMMAND) {
POST_COMMAND) {
pthread_mutex_unlock(&sock_client->bits.localsock.mutex); pthread_mutex_unlock(&sock_client->bits.localsock.mutex);
send_local_reply(sock_client, 0, send_local_reply(sock_client, 0,
sock_client->fd); sock_client->fd);
} else // PRE_COMMAND finished. } else {
{ /* PRE_COMMAND finished. */
pthread_mutex_unlock(&sock_client->bits.localsock.mutex); pthread_mutex_unlock(&sock_client->bits.localsock.mutex);
if ( if ((status = distribute_command(sock_client)))
(status = send_local_reply(sock_client, EFBIG,
distribute_command(sock_client)) != sock_client->fd);
0) send_local_reply(sock_client,
EFBIG,
sock_client->
fd);
} }
} }
} }
@ -1247,9 +1241,8 @@ static int read_from_local_sock(struct local_client *thisfd)
inheader->node + strlen(inheader->node) + 1; inheader->node + strlen(inheader->node) + 1;
while (missing_len > 0) { while (missing_len > 0) {
DEBUGLOG DEBUGLOG("got %d bytes, need another %d (total %d)\n",
("got %d bytes, need another %d (total %d)\n", argslen, missing_len, inheader->arglen);
argslen, missing_len, inheader->arglen);
len = read(thisfd->fd, argptr + argslen, len = read(thisfd->fd, argptr + argslen,
missing_len); missing_len);
if (len == -1 && errno == EINTR) if (len == -1 && errno == EINTR)