From 321293c6f46d399502cd8ff82ce449ee1af8c132 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 17 Mar 2008 11:51:58 -0400 Subject: Don't prepend /dev/ onto nfs devices. Also log mount errors to tty5. --- isys/imount.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'isys/imount.c') diff --git a/isys/imount.c b/isys/imount.c index ae47f7c65..4a495ccec 100644 --- a/isys/imount.c +++ b/isys/imount.c @@ -43,19 +43,20 @@ int doPwMount(char *dev, char *where, char *fs, char *options) { } if (strstr(fs, "nfs")) { - if (options) - rc = asprintf(&opts, "%s,nolock", options); - else - opts = strdup("nolock"); - } - else if (options) { - opts = strdup(options); + if (options) + rc = asprintf(&opts, "%s,nolock", options); + else + opts = strdup("nolock"); + device = strdup(dev); + } else { + if (*dev != '/') + rc = asprintf(&device, "/dev/%s", dev); + else + device = strdup(dev); + if (options) + opts = strdup(options); } - if (*dev != '/') - rc = asprintf(&device, "/dev/%s", dev); - else - device = strdup(dev); if (!(child = fork())) { int fd; @@ -63,12 +64,12 @@ int doPwMount(char *dev, char *where, char *fs, char *options) { /* Close off all these filehandles since we don't want errors * spewed to tty1. */ - fd = open("/dev/null", O_RDONLY); + fd = open("/dev/tty5", O_RDONLY); close(STDIN_FILENO); dup2(fd, STDIN_FILENO); close(fd); - fd = open("/dev/null", O_WRONLY); + fd = open("/dev/tty5", O_WRONLY); close(STDOUT_FILENO); dup2(fd, STDOUT_FILENO); close(STDERR_FILENO); -- cgit