summaryrefslogtreecommitdiffstats
path: root/lib/libdisk
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-06-28 22:28:50 +0000
committerjhb <jhb@FreeBSD.org>2000-06-28 22:28:50 +0000
commit033721fb7a75fd05ed0f793c8213356c46a8a9d1 (patch)
treee96ba5509252157fd997508ad46731fc923d92a3 /lib/libdisk
parent9997aef57dfa8d12364dfdef7ba1867545f09021 (diff)
downloadFreeBSD-src-033721fb7a75fd05ed0f793c8213356c46a8a9d1.zip
FreeBSD-src-033721fb7a75fd05ed0f793c8213356c46a8a9d1.tar.gz
_PATH_DEV'ify libdisk
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.c3
4 files changed, 11 insertions, 7 deletions
diff --git a/lib/libdisk/create_chunk.c b/lib/libdisk/create_chunk.c
index 2c6ad2d..4614d9a 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 c23c0ed..d625170 100644
--- a/lib/libdisk/disk.c
+++ b/lib/libdisk/disk.c
@@ -22,6 +22,7 @@
#include <sys/ioctl.h>
#include <sys/disklabel.h>
#include <sys/diskslice.h>
+#include <paths.h>
#include "libdisk.h"
#define DOSPTYP_EXTENDED 5
@@ -67,7 +68,7 @@ Int_Open_Disk(const char *name, u_long size)
#endif
u_long offset = 0;
- strcpy(device,"/dev/");
+ strcpy(device,_PATH_DEV);
strcat(device,name);
d = (struct disk *)malloc(sizeof *d);
@@ -236,7 +237,7 @@ Int_Open_Disk(const char *name, u_long size)
char pname[20];
int j,k;
- strcpy(pname,"/dev/");
+ strcpy(pname,_PATH_DEV);
strcat(pname,sname);
j = open(pname,O_RDONLY);
if (j < 0) {
@@ -301,7 +302,7 @@ Int_Open_Disk(const char *name, u_long size)
char pname[20];
int j,k;
- strcpy(pname,"/dev/");
+ strcpy(pname,_PATH_DEV);
strcat(pname,name);
j = open(pname,O_RDONLY);
if (j < 0) {
@@ -479,7 +480,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/%s", diskname);
+ sprintf(disk, _PATH_DEV"%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 9702ff2..1ad9421 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/");
+ strcpy(device,_PATH_DEV);
strcat(device,d->name);
fd = open(device,O_RDWR);
diff --git a/lib/libdisk/write_disk.c b/lib/libdisk/write_disk.c
index 2d15434..d839f63 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
@@ -181,7 +182,7 @@ Write_Disk(struct disk *d1)
int one = 1;
int zero = 0;
- strcpy(device,"/dev/");
+ strcpy(device,_PATH_DEV);
strcat(device,d1->name);
#ifdef PC98
OpenPOWER on IntegriCloud