#ifndef lint
static const char rcsid[] =
- "$Id: dumprmt.c,v 1.22 2002/07/19 14:57:39 stelian Exp $";
+ "$Id: dumprmt.c,v 1.23 2002/07/29 12:00:33 stelian Exp $";
#endif /* not lint */
#include <config.h>
#include <sys/mtio.h>
#include <sys/socket.h>
#include <sys/time.h>
+#include <fcntl.h>
#ifdef __linux__
#include <sys/types.h>
#ifdef HAVE_EXT2FS_EXT2_FS_H
#include <ctype.h>
#include <errno.h>
#include <compaterr.h>
+#include <rmtflags.h>
#include <netdb.h>
#include <pwd.h>
#include <stdio.h>
}
int
-rmtopen(const char *tape, const char *mode)
+rmtopen(const char *tape, const int mode)
{
char buf[MAXPATHLEN];
-
- (void)snprintf(buf, sizeof (buf), "O%s\n%s\n", tape, mode);
+ char *rmtflags;
+
+ rmtflags = rmtflags_tochar(mode);
+ (void)snprintf(buf, sizeof (buf), "O%s\n%d %s\n",
+ tape,
+ mode & O_ACCMODE,
+ rmtflags);
+ free(rmtflags);
rmtstate = TS_OPEN;
return (rmtcall(tape, buf));
}