@@ -42,7 +42,7 @@
install -d $(DESTDIR)$(mandir)
install -m 644 $(EXEC).8 $(DESTDIR)$(mandir)
install -d $(DESTDIR)$(man5dir)
- install -m 644 $(EXEC).5 $(DESTDIR)$(man5dir)
+ install -m 644 $(EXEC).conf.5 $(DESTDIR)$(man5dir)
@if [ ! -e $(DESTDIR)/etc/multipath.conf ]; then \
install -m 644 multipath.conf.redhat $(DESTDIR)/etc/multipath.conf; \
fi
@@ -311,6 +311,7 @@
return NULL;
p = reply;
+ p += sprintf(p, "fail\n");
p += sprintf(p, VERSION_STRING);
p += sprintf(p, "CLI commands reference:\n");
@@ -1756,8 +1756,8 @@
conf->verbosity = atoi(optarg);
break;
case 'k':
- uxclnt(optarg);
- exit(0);
+ err = uxclnt(optarg);
+ exit(err);
default:
;
}
@@ -51,16 +51,21 @@
}
}
-static void process_req(int fd, char * inbuf)
+static int process_req(int fd, char * inbuf)
{
char *reply;
size_t len;
+ int ret = 0;
send_packet(fd, inbuf, strlen(inbuf) + 1);
recv_packet(fd, &reply, &len);
+ if (strncmp(reply, "fail\n", 5) == 0)
+ ret = 1;
printf("%s", reply);
FREE(reply);
+
+ return ret;
}
/*
@@ -69,6 +74,7 @@
int uxclnt(char * inbuf)
{
int fd;
+ int r = 0;
fd = ux_socket_connect(DEFAULT_SOCKET);
if (fd == -1) {
@@ -77,9 +83,9 @@
}
if (inbuf)
- process_req(fd, inbuf);
+ r = process_req(fd, inbuf);
else
process(fd);
- return 0;
+ return r;
}