projects
/
debian
/
dump
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 0.4b43
[debian/dump]
/
rmt
/
rmt.c
diff --git
a/rmt/rmt.c
b/rmt/rmt.c
index 05874a3f6a52f2d2e01d833c3747deb8d0efc6e8..863f12651c68bd103a1972fd52a2078a889ead97 100644
(file)
--- a/
rmt/rmt.c
+++ b/
rmt/rmt.c
@@
-37,7
+37,7
@@
#ifndef lint
static const char rcsid[] =
#ifndef lint
static const char rcsid[] =
- "$Id: rmt.c,v 1.2
8 2003/11/22 16:52:16
stelian Exp $";
+ "$Id: rmt.c,v 1.2
9 2010/06/11 11:19:18
stelian Exp $";
#endif /* not linux */
/*
#endif /* not linux */
/*
@@
-310,8
+310,10
@@
top:
cp = record;
#endif
(void)sprintf(resp, "A%lld\n", (long long)rval);
cp = record;
#endif
(void)sprintf(resp, "A%lld\n", (long long)rval);
- (void)write(1, resp, strlen(resp));
- (void)write(1, cp, rval);
+ if (write(1, resp, strlen(resp)) != strlen(resp))
+ goto ioerror;
+ if (write(1, cp, rval) != rval)
+ goto ioerror;
block += n >> 10;
goto top;
block += n >> 10;
goto top;
@@
-475,13
+477,17
@@
top:
mtget.mt_fileno = swaplong(mtget.mt_fileno);
mtget.mt_blkno = swaplong(mtget.mt_blkno);
(void)sprintf(resp, "A%lld\n", (long long)rval);
mtget.mt_fileno = swaplong(mtget.mt_fileno);
mtget.mt_blkno = swaplong(mtget.mt_blkno);
(void)sprintf(resp, "A%lld\n", (long long)rval);
- (void)write(1, resp, strlen(resp));
- (void)write(1, (char *)&mtget, sizeof (mtget));
+ if (write(1, resp, strlen(resp)) != strlen(resp))
+ goto ioerror;
+ if (write(1, (char *)&mtget, sizeof (mtget)) != sizeof(mtget))
+ goto ioerror;
} else {
rval = sizeof (mtget);
(void)sprintf(resp, "A%lld\n", (long long)rval);
} else {
rval = sizeof (mtget);
(void)sprintf(resp, "A%lld\n", (long long)rval);
- (void)write(1, resp, strlen(resp));
- (void)write(1, (char *)&mtget, sizeof (mtget));
+ if (write(1, resp, strlen(resp)) != strlen(resp))
+ goto ioerror;
+ if (write(1, (char *)&mtget, sizeof (mtget)) != sizeof(mtget))
+ goto ioerror;
}
goto top;
}
}
goto top;
}
@@
-546,7
+552,8
@@
top:
respond:
DEBUG1("rmtd: A %lld\n", (long long)rval);
(void)sprintf(resp, "A%lld\n", (long long)rval);
respond:
DEBUG1("rmtd: A %lld\n", (long long)rval);
(void)sprintf(resp, "A%lld\n", (long long)rval);
- (void)write(1, resp, strlen(resp));
+ if (write(1, resp, strlen(resp)) != strlen(resp))
+ goto ioerror;
goto top;
ioerror:
error(errno);
goto top;
ioerror:
error(errno);
@@
-593,7
+600,8
@@
error(int num)
DEBUG2("rmtd: E %d (%s)\n", num, strerror(num));
(void)snprintf(resp, sizeof(resp), "E%d\n%s\n", num, strerror(num));
DEBUG2("rmtd: E %d (%s)\n", num, strerror(num));
(void)snprintf(resp, sizeof(resp), "E%d\n%s\n", num, strerror(num));
- (void)write(1, resp, strlen(resp));
+ if (write(1, resp, strlen(resp)) != strlen(resp))
+ DEBUG("rmtd: write error\n");
}
static unsigned long
}
static unsigned long