Ignore EEXIST
This commit is contained in:
parent
e5894fdf69
commit
18bda0a245
1 changed files with 1 additions and 13 deletions
14
lib/util.c
14
lib/util.c
|
@ -25,7 +25,7 @@ void error(int fatal, const char *fmt, ...)
|
||||||
vsnprintf(errorstr, error_len + 1, fmt, args);
|
vsnprintf(errorstr, error_len + 1, fmt, args);
|
||||||
fprintf(stderr, "[zsm] ");
|
fprintf(stderr, "[zsm] ");
|
||||||
|
|
||||||
if (errsv != 0) {
|
if (errsv != 0 && errsv != EEXIST) {
|
||||||
perror(errorstr);
|
perror(errorstr);
|
||||||
errno = 0;
|
errno = 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -56,18 +56,6 @@ void *estrdup(void *str)
|
||||||
return modstr;
|
return modstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Set socket to non blocking so epoll can use EPOLLET flag
|
|
||||||
*/
|
|
||||||
int set_nonblocking(int fd)
|
|
||||||
{
|
|
||||||
int flags = fcntl(fd, F_GETFL, 0);
|
|
||||||
if (flags == -1) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return fcntl(fd, F_SETFL, flags | O_NONBLOCK);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Takes heap-allocated str and replace ~ with home path
|
* Takes heap-allocated str and replace ~ with home path
|
||||||
* Returns heap-allocated newstr
|
* Returns heap-allocated newstr
|
||||||
|
|
Loading…
Reference in a new issue