-/* $OpenBSD: dumprmt.c,v 1.5 1996/09/02 22:15:02 millert Exp $ */
+/* $OpenBSD: dumprmt.c,v 1.6 1996/09/15 20:14:08 millert Exp $ */
/* $NetBSD: dumprmt.c,v 1.10 1996/03/15 22:39:26 scottr Exp $ */
/*-
setsockopt(rmtape, SOL_SOCKET, SO_SNDBUF, &size, sizeof (size)) < 0)
size -= TP_BSIZE;
(void)setsockopt(rmtape, SOL_SOCKET, SO_RCVBUF, &size, sizeof (size));
+
maxseg = 1024;
- if (getuid() == 0 && setsockopt(rmtape, IPPROTO_TCP, TCP_MAXSEG,
- &maxseg, sizeof (maxseg)) < 0)
- perror("TCP_MAXSEG setsockopt");
+ (void)setsockopt(rmtape, IPPROTO_TCP, TCP_MAXSEG, &maxseg,
+ sizeof (maxseg));
#ifdef notdef
if (setsockopt(rmtape, IPPROTO_TCP, TCP_NODELAY, &on, sizeof (on)) < 0)
{
char buf[256];
- (void)snprintf(buf, sizeof buf, "O%s\n%d\n", tape, mode);
+ (void)snprintf(buf, sizeof (buf), "O%s\n%d\n", tape, mode);
rmtstate = TS_OPEN;
return (rmtcall(tape, buf));
}
int n, i, cc;
extern errno;
- (void)sprintf(line, "R%d\n", count);
+ (void)snprintf(line, sizeof (line), "R%d\n", count);
n = rmtcall("read", line);
if (n < 0) {
errno = n;
{
char line[30];
- (void)sprintf(line, "W%d\n", count);
+ (void)snprintf(line, sizeof (line), "W%d\n", count);
write(rmtape, line, strlen(line));
write(rmtape, buf, count);
return (rmtreply("write"));
{
char line[30];
- (void)sprintf(line, "W%d\n", count);
+ (void)snprintf(line, sizeof (line), "W%d\n", count);
write(rmtape, line, strlen(line));
}
{
char line[80];
- (void)sprintf(line, "L%d\n%d\n", offset, pos);
+ (void)snprintf(line, sizeof (line), "L%d\n%d\n", offset, pos);
return (rmtcall("seek", line));
}
if (count < 0)
return (-1);
- (void)sprintf(buf, "I%d\n%d\n", cmd, count);
+ (void)snprintf(buf, sizeof (buf), "I%d\n%d\n", cmd, count);
return (rmtcall("ioctl", buf));
}