2006-04-12 23:25:51 +05:30
|
|
|
/* vi: set sw=4 ts=4: */
|
|
|
|
/*
|
|
|
|
* bb_xsocket.c - a socket() which dies on failure with error message
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Denis Vlasenko
|
|
|
|
*
|
2006-04-18 13:54:13 +05:30
|
|
|
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
2006-04-12 23:25:51 +05:30
|
|
|
*/
|
2006-07-10 17:11:19 +05:30
|
|
|
|
2006-04-12 23:25:51 +05:30
|
|
|
#include <sys/socket.h>
|
|
|
|
#include "libbb.h"
|
|
|
|
|
|
|
|
int bb_xsocket(int domain, int type, int protocol)
|
|
|
|
{
|
|
|
|
int r = socket(domain, type, protocol);
|
|
|
|
if (r < 0)
|
|
|
|
bb_perror_msg_and_die("socket");
|
|
|
|
return r;
|
|
|
|
}
|