fix randstring bug
ae.c: set errno when error is not a failing syscall.

In this way the caller is able to perform better error checking or to
use strerror() without the risk of meaningless error messages being
displayed.
Better error reporting when fd event creation fails.
s/adiacent/adjacent/

fixed typo in a comment (step 2 memcheck)
Multiple fixes for EVAL (issue #872).

1) The event handler was no restored after a timeout condition if the
   command was eventually executed with success.
2) The command was not converted to EVAL in case of errors in the middle
   of the execution.
3) Terrible duplication of code without any apparent reason.
Test: added regression for issue #872.
Comment in the call() function clarified a bit.
Makefile.dep updated.
Undo slave-master handshake when SLAVEOF sets a new slave.

Issue #828 shows how Redis was not correctly undoing a non-blocking
connection attempt with the previous master when the master was set to a
new address using the SLAVEOF command.

This was also a result of lack of refactoring, so now there is a
function to cancel the non blocking handshake with the master.
The new function is now used when SLAVEOF NO ONE is called or when
SLAVEOF is used to set the master to a different address.
CLIENT GETNAME and CLIENT SETNAME introduced.

Sometimes it is much simpler to debug complex Redis installations if it
is possible to assign clients a name that is displayed in the CLIENT
LIST output.

This is the case, for example, for "leaked" connections. The ability to
provide a name to the client makes it quite trivial to understand what
is the part of the code implementing the client not releasing the
resources appropriately.

Behavior:

    CLIENT SETNAME: set a name for the client, or remove the current
                    name if an empty name is set.
    CLIENT GETNAME: get the current name, or a nil.
    CLIENT LIST: now displays the client name if any.

Thanks to Mark Gravell for pushing this idea forward.
Typo fixed, ASCI -> ASCII.
Tests for CLIENT GETNAME/SETNAME.
fixed some typos.
Typo in sentinel.conf

Fixes a minor typo in sentinel.conf
redis-cli: save an RDB dump from remote server to local file.
redis-cli prompt bug fix
redis-cli --rdb fails if server sends a ping

Redis pings slaves in "pre-synchronization stage" with newlines. (See
https://github.com/antirez/redis/blob/2.6.9/src/replication.c#L814)
However, redis-cli does not expect this - it sees the newline as the end
of the bulk length line, and ends up returning 0 as bulk the length.
This manifests as the following when running redis-cli:

    $ ./src/redis-cli --rdb some_file
    SYNC sent to master, writing 0 bytes to 'some_file'
    Transfer finished with success.

With this commit, we just ignore leading newlines while reading the bulk
length line.

To reproduce the problem, load enough data into Redis so that the
preparation of the RDB snapshot takes long enough for a ping to occur
while redis-cli is waiting for the data.
Always exit if connection fails.

This avoids unnecessary core dumps. Fixes antirez/redis#894
Merge pull request #893 from nparry/fix-redis-cli-rdb

redis-cli --rdb fails if server sends a ping
Fix an error reply for CLIENT command