aboutsummaryrefslogtreecommitdiff
path: root/networking/nbd-client.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/nbd-client.c')
-rw-r--r--networking/nbd-client.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/networking/nbd-client.c b/networking/nbd-client.c
index 103756b59..0dc8d0c43 100644
--- a/networking/nbd-client.c
+++ b/networking/nbd-client.c
@@ -4,7 +4,7 @@
4 * Licensed under GPLv2, see file LICENSE in this source tree. 4 * Licensed under GPLv2, see file LICENSE in this source tree.
5 */ 5 */
6//config:config NBDCLIENT 6//config:config NBDCLIENT
7//config: bool "nbd-client (4.6 kb)" 7//config: bool "nbd-client (6 kb)"
8//config: default y 8//config: default y
9//config: help 9//config: help
10//config: Network block device client 10//config: Network block device client
@@ -163,7 +163,9 @@ int nbdclient_main(int argc, char **argv)
163 int sock, nbd; 163 int sock, nbd;
164 int ro; 164 int ro;
165 int proto_new; // 0 for old, 1 for new 165 int proto_new; // 0 for old, 1 for new
166#if BB_MMU
166 char *data; 167 char *data;
168#endif
167 169
168 // Make sure BLOCKDEV exists 170 // Make sure BLOCKDEV exists
169 nbd = xopen(device, O_RDWR); 171 nbd = xopen(device, O_RDWR);
@@ -200,7 +202,9 @@ int nbdclient_main(int argc, char **argv)
200 ioctl(nbd, NBD_SET_SIZE_BLOCKS, size_blocks); 202 ioctl(nbd, NBD_SET_SIZE_BLOCKS, size_blocks);
201 ioctl(nbd, NBD_CLEAR_SOCK); 203 ioctl(nbd, NBD_CLEAR_SOCK);
202 ro = !!(old_nbd_header.flags & htons(2)); 204 ro = !!(old_nbd_header.flags & htons(2));
205#if BB_MMU
203 data = old_nbd_header.data; 206 data = old_nbd_header.data;
207#endif
204 } else { 208 } else {
205 unsigned namelen; 209 unsigned namelen;
206 uint16_t handshake_flags; 210 uint16_t handshake_flags;
@@ -230,7 +234,9 @@ int nbdclient_main(int argc, char **argv)
230 ioctl(nbd, NBD_SET_FLAGS, 234 ioctl(nbd, NBD_SET_FLAGS,
231 ntohs(new_nbd_header.transmission_flags)); 235 ntohs(new_nbd_header.transmission_flags));
232 ro = !!(new_nbd_header.transmission_flags & htons(2)); 236 ro = !!(new_nbd_header.transmission_flags & htons(2));
237#if BB_MMU
233 data = new_nbd_header.data; 238 data = new_nbd_header.data;
239#endif
234 } 240 }
235 241
236 if (ioctl(nbd, BLKROSET, &ro) < 0) { 242 if (ioctl(nbd, BLKROSET, &ro) < 0) {