projects
/
swifty.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
015ac3f
)
raw: sw_close and sw_shutdown use list_remove_socket.
author
Razvan Deaconescu
<razvan.deaconescu@cs.pub.ro>
Sat, 21 May 2011 10:04:09 +0000
(13:04 +0300)
committer
Razvan Deaconescu
<razvan.deaconescu@cs.pub.ro>
Sat, 21 May 2011 10:28:20 +0000
(13:28 +0300)
src/raw/swift_raw.c
patch
|
blob
|
history
diff --git
a/src/raw/swift_raw.c
b/src/raw/swift_raw.c
index
6796854
..
cc1109a
100644
(file)
--- a/
src/raw/swift_raw.c
+++ b/
src/raw/swift_raw.c
@@
-376,6
+376,7
@@
int sw_setsockopt(int __fd, int __level, int __optname,
int sw_shutdown(int __fd, int __how)
{
struct sock_list *list;
int sw_shutdown(int __fd, int __how)
{
struct sock_list *list;
+ int rc;
/* Find socket in management structure. */
list = list_elem_from_socket(__fd);
/* Find socket in management structure. */
list = list_elem_from_socket(__fd);
@@
-406,8
+407,8
@@
int sw_shutdown(int __fd, int __how)
/* Remove socket from socket management structure. */
if (list->rw_state == STATE_SHUT_RDWR) {
/* Remove socket from socket management structure. */
if (list->rw_state == STATE_SHUT_RDWR) {
-
list = list_unlink
_socket(__fd);
- if (
list == NULL
) {
+
rc = list_remove
_socket(__fd);
+ if (
rc < 0
) {
errno = EBADF;
goto list_unlink_err;
}
errno = EBADF;
goto list_unlink_err;
}
@@
-428,11
+429,11
@@
list_unlink_err:
*/
int sw_close(int __fd)
{
*/
int sw_close(int __fd)
{
-
struct sock_list *list
;
+
int rc
;
/* Remove socket from socket management structure. */
/* Remove socket from socket management structure. */
-
list = list_unlink
_socket(__fd);
- if (
list == NULL
) {
+
rc = list_remove
_socket(__fd);
+ if (
rc < 0
) {
errno = EBADF;
goto list_unlink_err;
}
errno = EBADF;
goto list_unlink_err;
}