Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
818d729d
Commit
818d729d
authored
Mar 03, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system/fd_util: remove unused functions
parent
dd5daa07
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
154 deletions
+0
-154
fd_util.c
src/system/fd_util.c
+0
-108
fd_util.h
src/system/fd_util.h
+0
-46
No files found.
src/system/fd_util.c
View file @
818d729d
...
...
@@ -106,16 +106,6 @@ fd_set_nonblock(int fd)
}
int
dup_cloexec
(
int
oldfd
)
{
int
newfd
=
dup
(
oldfd
);
if
(
newfd
>=
0
)
fd_set_nonblock
(
newfd
);
return
newfd
;
}
int
open_cloexec
(
const
char
*
path_fs
,
int
flags
,
int
mode
)
{
int
fd
;
...
...
@@ -136,30 +126,6 @@ open_cloexec(const char *path_fs, int flags, int mode)
}
int
pipe_cloexec
(
int
fd
[
2
])
{
#ifdef WIN32
return
_pipe
(
fd
,
512
,
_O_BINARY
);
#else
int
ret
;
#ifdef HAVE_PIPE2
ret
=
pipe2
(
fd
,
O_CLOEXEC
);
if
(
ret
>=
0
||
errno
!=
ENOSYS
)
return
ret
;
#endif
ret
=
pipe
(
fd
);
if
(
ret
>=
0
)
{
fd_set_cloexec
(
fd
[
0
],
true
);
fd_set_cloexec
(
fd
[
1
],
true
);
}
return
ret
;
#endif
}
int
pipe_cloexec_nonblock
(
int
fd
[
2
])
{
#ifdef WIN32
...
...
@@ -186,53 +152,6 @@ pipe_cloexec_nonblock(int fd[2])
#endif
}
#ifndef WIN32
int
socketpair_cloexec
(
int
domain
,
int
type
,
int
protocol
,
int
sv
[
2
])
{
int
ret
;
#ifdef SOCK_CLOEXEC
ret
=
socketpair
(
domain
,
type
|
SOCK_CLOEXEC
,
protocol
,
sv
);
if
(
ret
>=
0
||
errno
!=
EINVAL
)
return
ret
;
#endif
ret
=
socketpair
(
domain
,
type
,
protocol
,
sv
);
if
(
ret
>=
0
)
{
fd_set_cloexec
(
sv
[
0
],
true
);
fd_set_cloexec
(
sv
[
1
],
true
);
}
return
ret
;
}
int
socketpair_cloexec_nonblock
(
int
domain
,
int
type
,
int
protocol
,
int
sv
[
2
])
{
int
ret
;
#if defined(SOCK_CLOEXEC) && defined(SOCK_NONBLOCK)
ret
=
socketpair
(
domain
,
type
|
SOCK_CLOEXEC
|
SOCK_NONBLOCK
,
protocol
,
sv
);
if
(
ret
>=
0
||
errno
!=
EINVAL
)
return
ret
;
#endif
ret
=
socketpair
(
domain
,
type
,
protocol
,
sv
);
if
(
ret
>=
0
)
{
fd_set_cloexec
(
sv
[
0
],
true
);
fd_set_nonblock
(
sv
[
0
]);
fd_set_cloexec
(
sv
[
1
],
true
);
fd_set_nonblock
(
sv
[
1
]);
}
return
ret
;
}
#endif
int
socket_cloexec_nonblock
(
int
domain
,
int
type
,
int
protocol
)
{
...
...
@@ -281,33 +200,6 @@ accept_cloexec_nonblock(int fd, struct sockaddr *address,
return
ret
;
}
#ifndef WIN32
ssize_t
recvmsg_cloexec
(
int
sockfd
,
struct
msghdr
*
msg
,
int
flags
)
{
#ifdef MSG_CMSG_CLOEXEC
flags
|=
MSG_CMSG_CLOEXEC
;
#endif
ssize_t
result
=
recvmsg
(
sockfd
,
msg
,
flags
);
if
(
result
>=
0
)
{
struct
cmsghdr
*
cmsg
=
CMSG_FIRSTHDR
(
msg
);
while
(
cmsg
!=
NULL
)
{
if
(
cmsg
->
cmsg_type
==
SCM_RIGHTS
)
{
const
int
*
fd_p
=
(
const
int
*
)
CMSG_DATA
(
cmsg
);
fd_set_cloexec
(
*
fd_p
,
true
);
}
cmsg
=
CMSG_NXTHDR
(
msg
,
cmsg
);
}
}
return
result
;
}
#endif
#ifdef HAVE_INOTIFY_INIT
int
...
...
src/system/fd_util.h
View file @
818d729d
...
...
@@ -55,13 +55,6 @@ int
fd_set_cloexec
(
int
fd
,
bool
enable
);
/**
* Wrapper for dup(), which sets the CLOEXEC flag on the new
* descriptor.
*/
int
dup_cloexec
(
int
oldfd
);
/**
* Wrapper for open(), which sets the CLOEXEC flag (atomically if
* supported by the OS).
*/
...
...
@@ -71,13 +64,6 @@ open_cloexec(const char *path_fs, int flags, int mode);
/**
* Wrapper for pipe(), which sets the CLOEXEC flag (atomically if
* supported by the OS).
*/
int
pipe_cloexec
(
int
fd
[
2
]);
/**
* Wrapper for pipe(), which sets the CLOEXEC flag (atomically if
* supported by the OS).
*
* On systems that supports it (everybody except for Windows), it also
* sets the NONBLOCK flag.
...
...
@@ -85,24 +71,6 @@ pipe_cloexec(int fd[2]);
int
pipe_cloexec_nonblock
(
int
fd
[
2
]);
#ifndef WIN32
/**
* Wrapper for socketpair(), which sets the CLOEXEC flag (atomically
* if supported by the OS).
*/
int
socketpair_cloexec
(
int
domain
,
int
type
,
int
protocol
,
int
sv
[
2
]);
/**
* Wrapper for socketpair(), which sets the flags CLOEXEC and NONBLOCK
* (atomically if supported by the OS).
*/
int
socketpair_cloexec_nonblock
(
int
domain
,
int
type
,
int
protocol
,
int
sv
[
2
]);
#endif
#ifdef ENABLE_LIBMPDCLIENT
/* Avoid symbol conflict with statically linked libmpdclient */
#define socket_cloexec_nonblock socket_cloexec_nonblock_noconflict
...
...
@@ -123,20 +91,6 @@ int
accept_cloexec_nonblock
(
int
fd
,
struct
sockaddr
*
address
,
size_t
*
address_length_r
);
#ifndef WIN32
struct
msghdr
;
/**
* Wrapper for recvmsg(), which sets the CLOEXEC flag (atomically if
* supported by the OS).
*/
ssize_t
recvmsg_cloexec
(
int
sockfd
,
struct
msghdr
*
msg
,
int
flags
);
#endif
#ifdef HAVE_INOTIFY_INIT
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment