From e6c63396b19236f97d6a4adc42b22a246fdec019 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 18 Mar 2002 06:57:51 +0000 Subject: 2002-03-17 Roland McGrath * main.c: Include . (main): Use `error' instead of perror + exit. (console_mode, console_owner, console_group): Use *_t, not int. --- console/main.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'console/main.c') diff --git a/console/main.c b/console/main.c index b571b580..8f34fc3d 100644 --- a/console/main.c +++ b/console/main.c @@ -21,9 +21,10 @@ #include #include #include +#include #include #include -#include +#include #include #include @@ -45,9 +46,9 @@ int trivfs_support_exec = 0; int trivfs_allow_open = O_READ|O_WRITE; /* Properties of the underlying node. */ -int console_mode; -int console_owner; -int console_group; +mode_t console_mode; +uid_t console_owner; +gid_t console_group; /* The argument line options. */ struct @@ -125,7 +126,7 @@ main (int argc, char **argv) struct stat st; argp_parse (&main_argp, argc, argv, 0, 0, 0); - + task_get_bootstrap_port (mach_task_self (), &bootstrap); if (bootstrap == MACH_PORT_NULL) { @@ -137,10 +138,7 @@ main (int argc, char **argv) err = trivfs_startup (bootstrap, 0, 0, 0, 0, 0, &fsys); mach_port_deallocate (mach_task_self (), bootstrap); if (err) - { - perror ("Starting translator"); - exit (1); - } + error (1, err, "Starting translator"); /* Initialize status from underlying node. */ err = io_stat (fsys->underlying, &st); @@ -164,8 +162,7 @@ main (int argc, char **argv) 0, 0, 0); return 0; -} - +} kern_return_t S_tioctl_tiocflush (struct trivfs_protid *cred, int queue_selector) @@ -183,7 +180,7 @@ S_tioctl_tiocflush (struct trivfs_protid *cred, int queue_selector) if (queue_selector & O_READ) vcons_flush_input (vcons); - if (queue_selector & O_WRITE) + if (queue_selector & O_WRITE) vcons_discard_output (vcons); return 0; -- cgit v1.2.3