diff options
author | joerg <joerg@FreeBSD.org> | 1996-11-27 01:01:52 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1996-11-27 01:01:52 +0000 |
commit | d16df05f6b291eac55b85041b6496eb537a8e29a (patch) | |
tree | 3e03803b3bf5deaacb62f9f00384e6bccc34cbb7 /usr.sbin | |
parent | 3dc5bc7a11b3956ffcc004275d07c5638fc34b0d (diff) | |
download | FreeBSD-src-d16df05f6b291eac55b85041b6496eb537a8e29a.zip FreeBSD-src-d16df05f6b291eac55b85041b6496eb537a8e29a.tar.gz |
Open devices read-only to test whether they are available. This
allows to use write-protected tapes...
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/sade/devices.c | 6 | ||||
-rw-r--r-- | usr.sbin/sysinstall/devices.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/sade/devices.c b/usr.sbin/sade/devices.c index aa0087f..3ab8e1a 100644 --- a/usr.sbin/sade/devices.c +++ b/usr.sbin/sade/devices.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: devices.c,v 1.49 1996/10/05 11:56:47 jkh Exp $ + * $Id: devices.c,v 1.50 1996/11/15 19:53:08 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -139,13 +139,13 @@ deviceTry(char *name, char *try) int fd; snprintf(try, FILENAME_MAX, "/dev/%s", name); - fd = open(try, O_RDWR); + fd = open(try, O_RDONLY); if (fd > 0) return fd; if (errno == EBUSY) return -1; snprintf(try, FILENAME_MAX, "/mnt/dev/%s", name); - fd = open(try, O_RDWR); + fd = open(try, O_RDONLY); return fd; } diff --git a/usr.sbin/sysinstall/devices.c b/usr.sbin/sysinstall/devices.c index aa0087f..3ab8e1a 100644 --- a/usr.sbin/sysinstall/devices.c +++ b/usr.sbin/sysinstall/devices.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: devices.c,v 1.49 1996/10/05 11:56:47 jkh Exp $ + * $Id: devices.c,v 1.50 1996/11/15 19:53:08 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -139,13 +139,13 @@ deviceTry(char *name, char *try) int fd; snprintf(try, FILENAME_MAX, "/dev/%s", name); - fd = open(try, O_RDWR); + fd = open(try, O_RDONLY); if (fd > 0) return fd; if (errno == EBUSY) return -1; snprintf(try, FILENAME_MAX, "/mnt/dev/%s", name); - fd = open(try, O_RDWR); + fd = open(try, O_RDONLY); return fd; } |