18 |
along with this program; if not, write to the Free Software |
along with this program; if not, write to the Free Software |
19 |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ |
20 |
|
|
|
|
|
21 |
#include <errno.h> |
#include <errno.h> |
22 |
#include <malloc.h> |
#include <malloc.h> |
23 |
|
|
29 |
#include "cons.h" |
#include "cons.h" |
30 |
#include "priv.h" |
#include "priv.h" |
31 |
|
|
32 |
struct port_bucket *cons_port_bucket; |
struct port_bucket *cons_port_bucket; |
33 |
struct port_class *cons_port_class; |
struct port_class *cons_port_class; |
34 |
|
|
35 |
|
|
36 |
error_t |
error_t |
37 |
cons_init (void) |
cons_init (void) |
38 |
{ |
{ |
45 |
if (!cons_port_bucket) |
if (!cons_port_bucket) |
46 |
return errno; |
return errno; |
47 |
|
|
48 |
cons_port_class = ports_create_class (NULL, NULL); |
cons_port_class = ports_create_class (cons_vcons_destroy, NULL); |
49 |
if (!cons_port_class) |
if (!cons_port_class) |
50 |
return errno; |
return errno; |
51 |
|
|
56 |
mutex_init (&cons->lock); |
mutex_init (&cons->lock); |
57 |
cons->vcons_list = NULL; |
cons->vcons_list = NULL; |
58 |
cons->vcons_last = NULL; |
cons->vcons_last = NULL; |
|
cons->active = NULL; |
|
59 |
cons->dir = opendir (_cons_file); |
cons->dir = opendir (_cons_file); |
60 |
cons->slack = _cons_slack; |
cons->slack = _cons_slack; |
61 |
if (!cons->dir) |
if (!cons->dir) |
82 |
return err; |
return err; |
83 |
} |
} |
84 |
dir_notify_port->cons = cons; |
dir_notify_port->cons = cons; |
|
dir_notify_port->vcons = NULL; |
|
85 |
|
|
86 |
dir_notify = ports_get_right (dir_notify_port); |
dir_notify = ports_get_right (dir_notify_port); |
87 |
err = dir_notice_changes (cons->dirport, dir_notify, |
err = dir_notice_changes (cons->dirport, dir_notify, |