summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-06-20 23:54:07 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-06-20 23:54:07 +0000
commitb52531dc5b9e7a86eeb47adc8738e793edc31915 (patch)
tree5f96fd097e1d6fa270fd58cb21cd4d8a42b8051d
parent012fae8a6d103a2f6988fb015dde01124c0ab6c3 (diff)
Include <hurd/startup.h> and <string.h>.
(shutdown_notify_class): Declare variable. (S_startup_dosync): Give enough args to ports_lookup_port. (S_startup_dosync/do1): Return a value. (arrange_shutdown_notification): Correct spelling of ports_create_port. Initialize shutdown_notify_class. (find_device): Construct arg to strcmp correctly. Correct spelling of ENXIO.
-rw-r--r--pfinet/main.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/pfinet/main.c b/pfinet/main.c
index db8cab0e..256ad88d 100644
--- a/pfinet/main.c
+++ b/pfinet/main.c
@@ -24,6 +24,8 @@
#include <arpa/inet.h>
#include <error.h>
#include <argp.h>
+#include <hurd/startup.h>
+#include <string.h>
int trivfs_fstype = FSTYPE_MISC;
int trivfs_fsid;
@@ -36,6 +38,8 @@ int trivfs_protid_nportclasses = 1;
struct port_class *trivfs_cntl_portclasses[1];
int trivfs_cntl_nportclasses = 1;
+struct port_class *shutdown_notify_class;
+
/* Option parser. */
extern struct argp pfinet_argp;
@@ -58,7 +62,7 @@ pfinet_demuxer (mach_msg_header_t *inp,
error_t
S_startup_dosync (mach_port_t handle)
{
- struct port_info *inpi = ports_lookup_port (pfinet_bucket,
+ struct port_info *inpi = ports_lookup_port (pfinet_bucket, handle,
shutdown_notify_class);
error_t
do1 (void *port)
@@ -67,6 +71,7 @@ S_startup_dosync (mach_port_t handle)
if (pi->class == socketport_class)
ports_destroy_right (pi);
+ return 0;
}
if (!inpi)
@@ -84,10 +89,12 @@ arrange_shutdown_notification ()
process_t procserver;
struct port_info *pi;
+ shutdown_notify_class = ports_create_class (0, 0);
+
/* Arrange to get notified when the system goes down,
but if we fail for some reason, just silently give up. No big deal. */
- err = ports_crease_port (shutdown_notify_class, pfinet_bucket,
+ err = ports_create_port (shutdown_notify_class, pfinet_bucket,
sizeof (struct port_info), &pi);
if (err)
return;
@@ -118,7 +125,7 @@ error_t
find_device (char *name, struct device **device)
{
if (already_open)
- if (!name || strcmp (already_open, device) == 0)
+ if (!name || strcmp (already_open, (*device)->name) == 0)
{
*device = &ether_dev;
return 0;
@@ -126,7 +133,7 @@ find_device (char *name, struct device **device)
else
return EBUSY; /* XXXACK */
else if (! name)
- return EXIO; /* XXX */
+ return ENXIO; /* XXX */
name = already_open = strdup (name);