summaryrefslogtreecommitdiff
path: root/lib/libdisk
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2000-07-14 06:30:59 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2000-07-14 06:30:59 +0000
commitb2bb34bdca4a2a730951a98e74c833165b5133ef (patch)
treeb9543a313bd74c58d12adbd31b0df37396f6b126 /lib/libdisk
parentda254dfc210a0385cbdf587f99c102063c83b9d4 (diff)
Notes
Diffstat (limited to 'lib/libdisk')
-rw-r--r--lib/libdisk/create_chunk.c3
-rw-r--r--lib/libdisk/disk.c9
-rw-r--r--lib/libdisk/tst01.c3
-rw-r--r--lib/libdisk/write_disk.c5
4 files changed, 12 insertions, 8 deletions
diff --git a/lib/libdisk/create_chunk.c b/lib/libdisk/create_chunk.c
index 929266477fe1..9aafdf367cfc 100644
--- a/lib/libdisk/create_chunk.c
+++ b/lib/libdisk/create_chunk.c
@@ -24,6 +24,7 @@
#include <sys/stat.h>
#include <err.h>
#include <grp.h>
+#include <paths.h>
#include <pwd.h>
#include "libdisk.h"
@@ -47,7 +48,7 @@ msgDebug(char *fmt, ...)
static int DebugFD = -1;
if (DebugFD == -1)
- DebugFD = open("/dev/ttyv1", O_RDWR);
+ DebugFD = open(_PATH_DEV"ttyv1", O_RDWR);
dbg = (char *)alloca(FILENAME_MAX);
strcpy(dbg, "DEBUG: ");
va_start(args, fmt);
diff --git a/lib/libdisk/disk.c b/lib/libdisk/disk.c
index 3929f1ec7cc9..73902cae4306 100644
--- a/lib/libdisk/disk.c
+++ b/lib/libdisk/disk.c
@@ -21,6 +21,7 @@
#include <sys/ioctl.h>
#include <sys/disklabel.h>
#include <sys/diskslice.h>
+#include <paths.h>
#include "libdisk.h"
#define DOSPTYP_EXTENDED 5
@@ -66,7 +67,7 @@ Int_Open_Disk(const char *name, u_long size)
#endif
u_long offset = 0;
- strcpy(device,"/dev/r");
+ strcpy(device,_PATH_DEV"r");
strcat(device,name);
d = (struct disk *)malloc(sizeof *d);
@@ -235,7 +236,7 @@ Int_Open_Disk(const char *name, u_long size)
char pname[20];
int j,k;
- strcpy(pname,"/dev/r");
+ strcpy(pname,_PATH_DEV"r");
strcat(pname,sname);
j = open(pname,O_RDONLY);
if (j < 0) {
@@ -300,7 +301,7 @@ Int_Open_Disk(const char *name, u_long size)
char pname[20];
int j,k;
- strcpy(pname,"/dev/r");
+ strcpy(pname,_PATH_DEV"r");
strcat(pname,name);
j = open(pname,O_RDONLY);
if (j < 0) {
@@ -460,7 +461,7 @@ Disk_Names()
for (j = 0; device_list[j]; j++) {
for (i = 0; i < MAX_NO_DISKS; i++) {
sprintf(diskname, "%s%d", device_list[j], i);
- sprintf(disk, "/dev/r%s", diskname);
+ sprintf(disk, _PATH_DEV"r%s", diskname);
if (stat(disk, &st) || !(st.st_mode & S_IFCHR))
continue;
if ((fd = open(disk, O_RDWR)) == -1)
diff --git a/lib/libdisk/tst01.c b/lib/libdisk/tst01.c
index c23169a3fcce..cd49b72a080e 100644
--- a/lib/libdisk/tst01.c
+++ b/lib/libdisk/tst01.c
@@ -21,6 +21,7 @@
#include <readline/history.h>
#endif
#include <sys/types.h>
+#include <paths.h>
#include "libdisk.h"
u_char mbr[] = {
@@ -91,7 +92,7 @@ Scan_Disk(struct disk *d)
u_long l;
int i,j,fd;
- strcpy(device,"/dev/r");
+ strcpy(device,_PATH_DEV"r");
strcat(device,d->name);
fd = open(device,O_RDWR);
diff --git a/lib/libdisk/write_disk.c b/lib/libdisk/write_disk.c
index 3de1890286f2..e56e1de16432 100644
--- a/lib/libdisk/write_disk.c
+++ b/lib/libdisk/write_disk.c
@@ -21,6 +21,7 @@
#include <sys/ioctl.h>
#include <sys/disklabel.h>
#include <sys/diskslice.h>
+#include <paths.h>
#include "libdisk.h"
#define DOSPTYP_EXTENDED 5
@@ -75,7 +76,7 @@ Write_FreeBSD(int fd, struct disk *new, struct disk *old, struct chunk *c1)
#endif
if (j < 0 || j >= MAXPARTITIONS || j == RAW_PART) {
#ifdef DEBUG
- warn("Weird parititon letter %c",c2->name[strlen(new->name) + 2]);
+ warn("weird partition letter %c",c2->name[strlen(new->name) + 2]);
#endif
continue;
}
@@ -181,7 +182,7 @@ Write_Disk(struct disk *d1)
int one = 1;
int zero = 0;
- strcpy(device,"/dev/r");
+ strcpy(device,_PATH_DEV"r");
strcat(device,d1->name);
#ifdef PC98