mirror of
https://github.com/brouhaha/tapeutils.git
synced 2026-01-11 23:53:18 +00:00
Build in macOS.
This commit is contained in:
parent
2d4559f2da
commit
f97498a3f0
17
read20.c
17
read20.c
@ -84,6 +84,23 @@ char *expression = 0;
|
||||
char *re_comp_error; /* Error message from re_comp() */
|
||||
extern char *re_comp();
|
||||
|
||||
#ifdef __APPLE__
|
||||
static regex_t re_regexp;
|
||||
|
||||
char *re_comp(char *s)
|
||||
{
|
||||
if (regcomp(&re_regexp, s, 0) == 0)
|
||||
return NULL;
|
||||
else
|
||||
return "error";
|
||||
}
|
||||
|
||||
static int re_exec(char *s)
|
||||
{
|
||||
return regexec(&re_regexp, s, 0, 0, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
read20 [-f tapefile] [-t] [-c] [-T] [-n number] pattern
|
||||
|
||||
|
||||
12
tapeio.c
12
tapeio.c
@ -53,6 +53,16 @@
|
||||
#define MTSETBLK STSETBLK
|
||||
#define MTSETDENSITY STSETDENSITY
|
||||
#define mtop stop
|
||||
#elif __APPLE__
|
||||
#define MTWEOF 0
|
||||
#define MTREW 0
|
||||
#define MTFSR 0
|
||||
#define MTFSF 0
|
||||
#define MTBSR 0
|
||||
#define MTIOCTOP 0
|
||||
#define MTSETBLK 0
|
||||
#define MTSETDENSITY 0
|
||||
struct mtop { int mt_op; int mt_count; };
|
||||
#else
|
||||
#include <sys/mtio.h>
|
||||
#endif
|
||||
@ -280,9 +290,11 @@ tape_handle_t opentape (char *name, int create, int writable)
|
||||
*p++ = '\0'; /* shoot out @, point at host name */
|
||||
user = (*p != '\0') ? host : NULL; /* keep non-null user */
|
||||
}
|
||||
#ifndef __APPLE__
|
||||
if ((mtape->tapefd = rexec (&p, htons (512), user, NULL, "/etc/rmt",
|
||||
(int *) NULL)) < 0)
|
||||
FAIL ("?Connection failed\n");
|
||||
#endif
|
||||
|
||||
/* build rmt "open device" command */
|
||||
if ((1 + strlen (port) + 1 + 1 + 1 + 1) > sizeof (mtape->netbuf))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user