|
From: <ljs...@us...> - 2006-10-19 00:21:22
|
Revision: 379
http://svn.sourceforge.net/cadcdev/?rev=379&view=rev
Author: ljsebald
Date: 2006-10-18 17:20:31 -0700 (Wed, 18 Oct 2006)
Log Message:
-----------
Committing two fixes to the sockets and related code:
- net_udp.c: Only try to destroy the mutex/condvar if they were created.
- fs_socket.c: Fix a stupid problem that broke all other filesystems if
fs_socket was initialized.
Modified Paths:
--------------
kos/kernel/fs/fs_socket.c
kos/kernel/net/net_udp.c
Modified: kos/kernel/fs/fs_socket.c
===================================================================
--- kos/kernel/fs/fs_socket.c 2006-09-18 04:25:42 UTC (rev 378)
+++ kos/kernel/fs/fs_socket.c 2006-10-19 00:20:31 UTC (rev 379)
@@ -50,7 +50,7 @@
static vfs_handler_t vh = {
/* Name handler */
{
- { 0 }, /* Name */
+ "/sock", /* Name */
0, /* tbfi */
0x00010000, /* Version 1.0 */
0, /* Flags */
Modified: kos/kernel/net/net_udp.c
===================================================================
--- kos/kernel/net/net_udp.c 2006-09-18 04:25:42 UTC (rev 378)
+++ kos/kernel/net/net_udp.c 2006-10-19 00:20:31 UTC (rev 379)
@@ -42,8 +42,8 @@
LIST_HEAD(udp_sock_list, udp_sock);
static struct udp_sock_list net_udp_sockets = LIST_HEAD_INITIALIZER(0);
-static mutex_t *udp_mutex;
-static condvar_t *udp_packets_ready;
+static mutex_t *udp_mutex = NULL;
+static condvar_t *udp_packets_ready = NULL;
int net_udp_accept(net_socket_t *hnd, struct sockaddr *addr,
socklen_t *addr_len) {
@@ -677,6 +677,8 @@
if(udp_packets_ready == NULL) {
mutex_destroy(udp_mutex);
+ udp_mutex = NULL;
+
return -1;
}
@@ -684,6 +686,9 @@
}
void net_udp_shutdown() {
- mutex_destroy(udp_mutex);
- cond_destroy(udp_packets_ready);
+ if(udp_mutex != NULL)
+ mutex_destroy(udp_mutex);
+
+ if(udp_packets_ready != NULL)
+ cond_destroy(udp_packets_ready);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|