aboutsummaryrefslogtreecommitdiff
path: root/console/console.c
diff options
context:
space:
mode:
Diffstat (limited to 'console/console.c')
-rw-r--r--console/console.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/console/console.c b/console/console.c
index 118787eb..0b1f42c4 100644
--- a/console/console.c
+++ b/console/console.c
@@ -1,5 +1,8 @@
/* console.c -- A console server.
- Copyright (C) 1997, 1999, 2002, 2003 Free Software Foundation, Inc.
+
+ Copyright (C) 1997, 1999, 2002, 2003, 2007, 2008, 2010
+ Free Software Foundation, Inc.
+
Written by Miles Bader and Marcus Brinkmann.
This program is free software; you can redistribute it and/or
@@ -20,6 +23,7 @@
#include <stdlib.h>
#include <stddef.h>
#include <unistd.h>
+#include <locale.h>
#include <argp.h>
#include <argz.h>
@@ -223,7 +227,7 @@ vcons_lookup (cons_t cons, int id, int create, vcons_t *r_vcons)
vcons = calloc (1, sizeof (struct vcons));
if (!vcons)
{
- mutex_unlock (&vcons->cons->lock);
+ mutex_unlock (&cons->lock);
return ENOMEM;
}
vcons->cons = cons;
@@ -240,7 +244,7 @@ vcons_lookup (cons_t cons, int id, int create, vcons_t *r_vcons)
{
free (vcons->name);
free (vcons);
- mutex_unlock (&vcons->cons->lock);
+ mutex_unlock (&cons->lock);
return err;
}
@@ -250,7 +254,7 @@ vcons_lookup (cons_t cons, int id, int create, vcons_t *r_vcons)
display_destroy (vcons->display);
free (vcons->name);
free (vcons);
- mutex_unlock (&vcons->cons->lock);
+ mutex_unlock (&cons->lock);
return err;
}
@@ -500,18 +504,12 @@ netfs_attempt_utimes (struct iouser *cred, struct node *node,
if (! err)
{
if (mtime)
- {
- node->nn_stat.st_mtime = mtime->tv_sec;
- node->nn_stat.st_mtime_usec = mtime->tv_nsec / 1000;
- }
+ node->nn_stat.st_mtim = *mtime;
else
flags |= TOUCH_MTIME;
if (atime)
- {
- node->nn_stat.st_atime = atime->tv_sec;
- node->nn_stat.st_atime_usec = atime->tv_nsec / 1000;
- }
+ node->nn_stat.st_atim = *atime;
else
flags |= TOUCH_ATIME;
@@ -864,7 +862,6 @@ netfs_get_dirents (struct iouser *cred, struct node *dir,
if (!add_dir_entry (vcons->name,
vcons->id << 2, DT_DIR))
break;
- mutex_unlock (&dir->nn->cons->lock);
}
else
{
@@ -882,7 +879,10 @@ netfs_get_dirents (struct iouser *cred, struct node *dir,
add_dir_entry ("input", (dir->nn->vcons->id << 3) + 2, DT_FIFO);
}
}
-
+
+ if (dir->nn->cons)
+ mutex_unlock(&dir->nn->cons->lock);
+
fshelp_touch (&dir->nn_stat, TOUCH_ATIME, console_maptime);
return err;
}
@@ -1368,7 +1368,7 @@ parse_color (const char *name, int *number)
errno = 0;
nr = strtol (name, &tail, 0);
- if (errno || &tail || nr < 0 || nr > CONS_COLOR_MAX)
+ if (errno || *tail || nr < 0 || nr > CONS_COLOR_MAX)
return EINVAL;
*number = nr;
return 0;
@@ -2021,6 +2021,8 @@ main (int argc, char **argv)
/* Parse our command line arguments. */
argp_parse (&netfs_std_runtime_argp, argc, argv, 0, 0, cons);
+ setlocale (LC_CTYPE, "C.UTF-8");
+
task_get_bootstrap_port (mach_task_self (), &bootstrap);
netfs_init ();