view lib/net.c @ 1098:46d83f3c7546 draft

Here's a revised cpio. I've reduced the use of malloc(), dropped an extra function call, and -at least in theory- allowed proper handling of non-regular files. (If we have a file we can't read, we still should record it when it's of a type where file content is ignored).
author Isaac Dunham <ibid.ag@gmail.com>
date Sun, 27 Oct 2013 19:11:07 -0500
parents aca8323e2690
children e11684e3bbc5
line wrap: on
line source

#include "toys.h"
#include "toynet.h"

int xsocket(int domain, int type, int protocol)
{
  int fd = socket(domain, type, protocol);

  if (fd < 0) perror_exit("socket %x %x", type, protocol);
  return fd;
}