summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorsr2012-08-25 18:59:12 +0200
committersr2012-08-25 18:59:12 +0200
commitcbf9d922fdbe19e65e8710dd72d6832e35144fc5 (patch)
tree19e09a155d2492ef43d8e708c3c5a979c033ebb4 /src/client
parent[*] Fix bug in serializer_get_* (diff)
downloaddnbd3-cbf9d922fdbe19e65e8710dd72d6832e35144fc5.tar.gz
dnbd3-cbf9d922fdbe19e65e8710dd72d6832e35144fc5.tar.xz
dnbd3-cbf9d922fdbe19e65e8710dd72d6832e35144fc5.zip
[KERNEL] Make it possible to receive push messages by the server
Diffstat (limited to 'src/client')
-rw-r--r--src/client/client.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/client.c b/src/client/client.c
index 86b7cb9..c3318f4 100644
--- a/src/client/client.c
+++ b/src/client/client.c
@@ -95,6 +95,7 @@ int main(int argc, char *argv[])
msg.read_ahead_kb = DEFAULT_READ_AHEAD_KB;
msg.port = htons(PORT);
msg.addrtype = 0;
+ msg.imgname = NULL;
int opt = 0;
int longIndex = 0;
@@ -166,7 +167,7 @@ int main(int argc, char *argv[])
fd = open(dev, O_WRONLY);
printf("INFO: Closing device %s\n", dev);
- const int ret = ioctl(fd, IOCTL_OPEN, &msg);
+ const int ret = ioctl(fd, IOCTL_CLOSE, &msg);
if (ret < 0)
{
printf("ERROR: ioctl not successful (close, errcode: %d)\n", ret);
@@ -183,9 +184,10 @@ int main(int argc, char *argv[])
fd = open(dev, O_WRONLY);
printf("INFO: Switching device %s to %s\n", dev, "<fixme>");
- if (ioctl(fd, IOCTL_SWITCH, &msg) < 0)
+ const int ret = ioctl(fd, IOCTL_SWITCH, &msg);
+ if (ret < 0)
{
- printf("ERROR: ioctl not successful (switch)\n");
+ printf("ERROR: ioctl not successful (switch, errcode: %d)\n", ret);
exit(EXIT_FAILURE);
}