mirror of
https://github.com/troglobit/finit.git
synced 2026-11-10 16:31:21 +00:00
Minor, fix local shadowing of scope global variable
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
da6fa482e7
commit
f8bed5c7af
1 file changed
+5
-9
+5
-9
@@ -28,6 +28,7 @@
|
|||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
|
#include "initctl.h"
|
||||||
|
|
||||||
static int sd = -1;
|
static int sd = -1;
|
||||||
|
|
||||||
@@ -72,11 +73,10 @@ int client_disconnect(void)
|
|||||||
int client_send(struct init_request *rq, ssize_t len)
|
int client_send(struct init_request *rq, ssize_t len)
|
||||||
{
|
{
|
||||||
struct pollfd pfd = { 0 };
|
struct pollfd pfd = { 0 };
|
||||||
int sd, result = 255;
|
int result = 255;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
sd = client_connect();
|
if (client_connect() == -1)
|
||||||
if (-1 == sd)
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
pfd.fd = sd;
|
pfd.fd = sd;
|
||||||
@@ -120,15 +120,13 @@ exit:
|
|||||||
|
|
||||||
svc_t *client_svc_iterator(int first)
|
svc_t *client_svc_iterator(int first)
|
||||||
{
|
{
|
||||||
int sd = -1;
|
|
||||||
struct init_request rq = {
|
struct init_request rq = {
|
||||||
.magic = INIT_MAGIC,
|
.magic = INIT_MAGIC,
|
||||||
.cmd = INIT_CMD_SVC_ITER,
|
.cmd = INIT_CMD_SVC_ITER,
|
||||||
};
|
};
|
||||||
static svc_t svc;
|
static svc_t svc;
|
||||||
|
|
||||||
sd = client_connect();
|
if (client_connect() == -1)
|
||||||
if (sd == -1)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (first)
|
if (first)
|
||||||
@@ -161,10 +159,8 @@ svc_t *do_cmd(int cmd, const char *arg)
|
|||||||
.cmd = cmd,
|
.cmd = cmd,
|
||||||
};
|
};
|
||||||
static svc_t svc;
|
static svc_t svc;
|
||||||
int sd = -1;
|
|
||||||
|
|
||||||
sd = client_connect();
|
if (client_connect() == -1)
|
||||||
if (sd == -1)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
strlcpy(rq.data, arg, sizeof(rq.data));
|
strlcpy(rq.data, arg, sizeof(rq.data));
|
||||||
|
|||||||
Reference in new issue
Block a user