Open devices read-only to test whether they are available. This
allows to use write-protected tapes...
This commit is contained in:
parent
c1565990a1
commit
4b8d17f492
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user