_PATH_DEV'ify libdisk

This commit is contained in:
John Baldwin 2000-06-28 22:28:50 +00:00
parent e962a82308
commit 61e9944f4f
4 changed files with 11 additions and 7 deletions

View File

@ -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);

View File

@ -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)

View File

@ -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);

View File

@ -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