view lib/net.c @ 1458:4428d64c0c40 draft

Don't hang for $CPUS=1. echo prints a newline if it has nothing to print, so wc -l always returns at least 1. Fix: echo -n
author Rob Landley <rob@landley.net>
date Thu, 04 Sep 2014 00:23:51 -0500
parents e11684e3bbc5
children
line wrap: on
line source

#include "toys.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;
}