Mercurial > hg > toybox
annotate lib/net.c @ 1766:190ecf70fbe5 draft
Fix an obvious typo in Makefile.
author | Elliott Hughes <enh@google.com> |
---|---|
date | Sat, 28 Mar 2015 13:13:42 -0500 |
parents | e11684e3bbc5 |
children |
rev | line source |
---|---|
883
aca8323e2690
Add posix headers to toynet.h, move xioctl() to lib.c, introduce lib/net.c and move xsocket() to it.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
1 #include "toys.h" |
aca8323e2690
Add posix headers to toynet.h, move xioctl() to lib.c, introduce lib/net.c and move xsocket() to it.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 |
aca8323e2690
Add posix headers to toynet.h, move xioctl() to lib.c, introduce lib/net.c and move xsocket() to it.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
3 int xsocket(int domain, int type, int protocol) |
aca8323e2690
Add posix headers to toynet.h, move xioctl() to lib.c, introduce lib/net.c and move xsocket() to it.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
4 { |
aca8323e2690
Add posix headers to toynet.h, move xioctl() to lib.c, introduce lib/net.c and move xsocket() to it.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
5 int fd = socket(domain, type, protocol); |
aca8323e2690
Add posix headers to toynet.h, move xioctl() to lib.c, introduce lib/net.c and move xsocket() to it.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
6 |
aca8323e2690
Add posix headers to toynet.h, move xioctl() to lib.c, introduce lib/net.c and move xsocket() to it.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
7 if (fd < 0) perror_exit("socket %x %x", type, protocol); |
aca8323e2690
Add posix headers to toynet.h, move xioctl() to lib.c, introduce lib/net.c and move xsocket() to it.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
8 return fd; |
aca8323e2690
Add posix headers to toynet.h, move xioctl() to lib.c, introduce lib/net.c and move xsocket() to it.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
9 } |