Home > Articles > Programming

  • Print
  • + Share This

Making Changes to Files

Once CVS has created a working directory tree, you can edit, compile and test the files it contains in the usual way — they're just files.

For example, suppose we try compiling the package we just checked out:

$ make
gcc -g -Wall  -lnsl -lsocket  httpc.c   -o httpc
httpc.c: In function `tcp_connection':
httpc.c:48: warning: passing arg 2 of `connect' from incompatible pointer type
$

It seems that httpc.c hasn't been ported to this operating system yet. We need to cast one of the arguments to connect. To fix that, line 48 must change from this

if (connect (sock, &name, sizeof (name)) >= 0)

to this

if (connect (sock, (struct sockaddr *) &name, sizeof (name)) >= 0)

Now it should compile:

$ make
gcc -g -Wall  -lnsl -lsocket  httpc.c   -o httpc
$ httpc GET http://www.cyclic.com
... HTML text for Cyclic Software's home page follows ...
$
  • + Share This
  • 🔖 Save To Your Account

Related Resources

There are currently no related titles. Please check back later.