improve error message
This commit is contained in:
parent
6a6dd32dea
commit
8ec00f1710
@ -10,6 +10,7 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
int open_shipper_socket(char *pathname) {
|
int open_shipper_socket(char *pathname) {
|
||||||
int fd;
|
int fd;
|
||||||
@ -22,7 +23,7 @@ int open_shipper_socket(char *pathname) {
|
|||||||
fd = socket(AF_LOCAL, SOCK_STREAM, 0);
|
fd = socket(AF_LOCAL, SOCK_STREAM, 0);
|
||||||
if(fd >= 0) {
|
if(fd >= 0) {
|
||||||
if(connect(fd, (struct sockaddr *) &sa, sizeof sa)) {
|
if(connect(fd, (struct sockaddr *) &sa, sizeof sa)) {
|
||||||
perror("connect socket");
|
error(0, errno, "connect socket \"%s\"", pathname);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
int flags = fcntl(fd, F_GETFL);
|
int flags = fcntl(fd, F_GETFL);
|
||||||
|
Loading…
Reference in New Issue
Block a user