Ask GCC to help to review this code :)

Change Makefile to include -Wall (all warnings) while compiling.
Fix includes

According to a manual, headers <sys/socket.h> and <netinet/in.h> must
be included for struct sockaddr_in.

Some files were using close(2) without including header <unistd.h>.

According to man(1), headers <sys/socket.h>, <netinet/in.h>,
and <arpa/inet.h> must be included for inet_aton(3), and
headers <sys/types.h> and <sys/socket.h> must be included for sendto(2)
and setsockopt(2).

The headers <stdlib.h> and <string.h> shouldn't be in eutils.h since
it doesn't make use of them.

Own headers (i.e. includes with quotes) are included after other headers.
dopt keyword const in eutils

Also fix inconsistent use of variable names `nbytes' and `n'
between eutil.h and eutils.c.
Fix errors found by GCC -Wall

gcc -o eserv -Wall eserv.c eutils.c
eserv.c: In function ‘main’:
eserv.c:58:3: warning: implicit declaration of function ‘print_error’ [-Wimplicit-function-declaration]

gcc -o ecli -Wall ecli.c eutils.c
ecli.c: In function ‘process_file’:
ecli.c:27:14: warning: unused variable ‘n_rcvd’ [-Wunused-variable]

gcc -o eclicork -Wall eclicork.c eutils.c
eclicork.c: In function ‘process_file’:
eclicork.c:82:14: warning: unused variable ‘n_rcvd’ [-Wunused-variable]
Remove unnecessary #define _GNU_SOURCE
Drop perrorq() in favor of standard assert(3)
Push knowledge about copy_name into fopen_copy()

The knowledge about how to allocate variable copy_name was being
spread every time one needed to open a copy file.

This knowledge is centralized now at function fopen_copy, what avoids
mistakes allocationg copy_name, and simplify maintenance.
Minor rewrite of code

This rewrite is not a quality issue, that is, it'd be acceptable.

I only rewrote it because I think it became slitly more readable.
Unify process_file()

To unify this function the main aspect was to notice that

1. empty_cork(), uncork(), and cork() could be called outside of
   process_file() in eclicork.c.

2. The previous calls, and value of variable max were the only difference
   betwee process_file in ecli.c and eclicork.c.

Notice that this rearrange of process_file() highlights a bug in
eclicork.c, namely, it's not corking and uncorking while processing
a file as it was originally intended!
Make memset() calls safer

Calling memset((char *)&srv, 0, sizeof(struct sockaddr_in)) is dangerous
because the type of srv may change in the future, and all lines like this
one would have to be found without compiler's help!

The line below is safer:
memset(&srv, 0, sizeof(srv));

The typecast is also unnecessary since memset() waits for a void *.

This patch also fix deallocation order.
Make clients' verification of parameters uniform

What was making that different was that eclicork.c was also
restricting CORK_SIZE to be less or equal to the maximum size of
a UDP packet.  This restriction doesn't make sense because it is,
in fact, an interesting testing case.
Simplify process_text() in eclicork.c
Simplify eserv.c

eserv.c was calling recv_packet() only once, and was the only caller.
Thus, recv_packet() was moved from eutils.c to eserv.c.
Since recv_packet() was very simple, it was also merged with echo().

Fixed typecast in the call of bind() as well as its sizeof parameter.

Call of recvfrom() in main() was corrected.
Fix a const typecast and make sizeofs safer
Fix bugs in recv_write()

recv_write() was losing the servers address because it was using it
to call recvfrom().  The bug was caught by the compiler because
the cast was forcing the const srv to be not const.

Add code to check that the packet came from the server.
Remove ambiguous use of name `srv'

Not only was the name `srv' used to refer to `server', but
it was also used to refer to `source' and `destination'.