Skip to content

Commit

Permalink
Be a bit more helpful when someone tries something silly.
Browse files Browse the repository at this point in the history
  • Loading branch information
yoe committed Feb 11, 2013
1 parent 902c07e commit c50a675
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions nbd-client.c
Expand Up @@ -278,8 +278,11 @@ void negotiate(int sock, u64 *rsize64, u32 *flags, char* name, uint32_t needed_f
if (write(sock, name, strlen(name)) < 0)
err("Failed/2.4: %m");
} else {
if (magic != cliserv_magic)
err("Not enough cliserv_magic");
if (magic != cliserv_magic) {
if(magic != opts_magic)
err("Not enough cliserv_magic");
else
err("It looks like you're trying to connect to a newstyle server with the oldstyle protocol. Try the -N option.");
printf(".");
}

Expand Down

0 comments on commit c50a675

Please sign in to comment.