Nicolas Cornu
2015-Nov-10 13:51 UTC
[syslinux] [PATCH] mtools: Remove local xpread/xpwrite, use ones from syslxcom
From: Nicolas Cornu <ncornu at aldebaran.com>
---
mtools/Makefile | 1 +
mtools/syslinux.c | 59 +------------------------------------------------------
2 files changed, 2 insertions(+), 58 deletions(-)
diff --git a/mtools/Makefile b/mtools/Makefile
index 0d0b1b2..c980420 100755
--- a/mtools/Makefile
+++ b/mtools/Makefile
@@ -9,6 +9,7 @@ SRCS = syslinux.c \
../libinstaller/fs.c \
../libinstaller/syslxmod.c \
../libinstaller/syslxopt.c \
+ ../libinstaller/syslxcom.c \
../libinstaller/setadv.c \
../libinstaller/bootsect_bin.c \
../libinstaller/ldlinux_bin.c \
diff --git a/mtools/syslinux.c b/mtools/syslinux.c
index 5924430..3686be0 100755
--- a/mtools/syslinux.c
+++ b/mtools/syslinux.c
@@ -42,8 +42,8 @@
#include "setadv.h"
#include "syslxopt.h"
#include "syslxfs.h"
+#include "syslxcom.h"
-char *program; /* Name of program */
pid_t mypid;
void __attribute__ ((noreturn)) die(const char *msg)
@@ -59,63 +59,6 @@ void __attribute__ ((noreturn)) die_err(const char *msg)
}
/*
- * read/write wrapper functions
- */
-ssize_t xpread(int fd, void *buf, size_t count, off_t offset)
-{
- char *bufp = (char *)buf;
- ssize_t rv;
- ssize_t done = 0;
-
- while (count) {
- rv = pread(fd, bufp, count, offset);
- if (rv == 0) {
- die("short read");
- } else if (rv == -1) {
- if (errno == EINTR) {
- continue;
- } else {
- die(strerror(errno));
- }
- } else {
- bufp += rv;
- offset += rv;
- done += rv;
- count -= rv;
- }
- }
-
- return done;
-}
-
-ssize_t xpwrite(int fd, const void *buf, size_t count, off_t offset)
-{
- const char *bufp = (const char *)buf;
- ssize_t rv;
- ssize_t done = 0;
-
- while (count) {
- rv = pwrite(fd, bufp, count, offset);
- if (rv == 0) {
- die("short write");
- } else if (rv == -1) {
- if (errno == EINTR) {
- continue;
- } else {
- die(strerror(errno));
- }
- } else {
- bufp += rv;
- offset += rv;
- done += rv;
- count -= rv;
- }
- }
-
- return done;
-}
-
-/*
* Version of the read function suitable for libfat
*/
int libfat_xpread(intptr_t pp, void *buf, size_t secsize,
--
2.6.2
Paulo Alcantara
2015-Nov-10 22:18 UTC
[syslinux] [PATCH] mtools: Remove local xpread/xpwrite, use ones from syslxcom
On Tue, 10 Nov 2015 14:51:04 +0100 Nicolas Cornu via Syslinux <syslinux at zytor.com> wrote:> From: Nicolas Cornu <ncornu at aldebaran.com> > > --- > mtools/Makefile | 1 + > mtools/syslinux.c | 59 > +------------------------------------------------------ 2 files > changed, 2 insertions(+), 58 deletions(-)Applied. Please, next time make sure you Signed-off-by your patch before sending it out. Thanks for the contribution! Paulo -- Paulo Alcantara, HP Inc. Speaking for myself only.
Celelibi
2015-Nov-11 01:01 UTC
[syslinux] [PATCH] mtools: Remove local xpread/xpwrite, use ones from syslxcom
2015-11-10 23:18 UTC+01:00, Paulo Alcantara via Syslinux <syslinux at zytor.com>:> On Tue, 10 Nov 2015 14:51:04 +0100 > Nicolas Cornu via Syslinux <syslinux at zytor.com> wrote: > >> From: Nicolas Cornu <ncornu at aldebaran.com> >> >> --- >> mtools/Makefile | 1 + >> mtools/syslinux.c | 59 >> +------------------------------------------------------ 2 files >> changed, 2 insertions(+), 58 deletions(-) > > Applied. Please, next time make sure you Signed-off-by your patch > before sending it out. Thanks for the contribution! > > Paulo > > -- > Paulo Alcantara, HP Inc. > Speaking for myself only. > _______________________________________________ > Syslinux mailing list > Submissions to Syslinux at zytor.com > Unsubscribe or set options at: > http://www.zytor.com/mailman/listinfo/syslinux >I haven't received a mail on the syslinux-commits ML but the commit still appear on the repositories. Celelibi
Maybe Matching Threads
- [PATCH] mtools: Remove local xpread/xpwrite, use ones from syslxcom
- [PATCH] mtools: Remove local xpread/xpwrite, use ones from syslxcom
- [GIT PULL] syslinux command-line
- [PATCH 1/3] ALPHA: make sector size dynamic in extlinux
- [PATCH] extlinux: code cleanup and simplification