[oe-commits] org.oe.dev libgsmd: band-aid. stage common/linux_list.h and fix up the mlbuf

pH5 commit openembedded-commits at lists.openembedded.org
Mon Aug 20 17:51:13 UTC 2007


libgsmd: band-aid. stage common/linux_list.h and fix up the mlbuf 
changes until this is repaired upstream

Author: pH5 at openembedded.org
Branch: org.openembedded.dev
Revision: 93974111864d318a6e96f9646847c5a9647aa819
ViewMTN: http://monotone.openembedded.org/revision.psp?id=93974111864d318a6e96f9646847c5a9647aa819
Files:
1
packages/gsm/files/fix-mlbuf.patch
packages/gsm/libgsmd_svn.bb
Diffs:

#
# mt diff -rb7ecd3fb6f5dac44f9fe8b851242aa671d666c3a -r93974111864d318a6e96f9646847c5a9647aa819
#
# 
# 
# add_file "packages/gsm/files/fix-mlbuf.patch"
#  content [557dce80239fff8ac79176198ecf6c19a3aaa4e0]
# 
# patch "packages/gsm/libgsmd_svn.bb"
#  from [6387ca7f099a514f35eed5b601884e71694739b2]
#    to [ba98d351988038ba9049d25dc6f82ae76c983ee7]
# 
============================================================
--- packages/gsm/files/fix-mlbuf.patch	557dce80239fff8ac79176198ecf6c19a3aaa4e0
+++ packages/gsm/files/fix-mlbuf.patch	557dce80239fff8ac79176198ecf6c19a3aaa4e0
@@ -0,0 +1,50 @@
+Index: gsm/src/gsmd/atcmd.c
+===================================================================
+--- gsm/src/gsmd/atcmd.c	(revision 2745)
++++ gsm/src/gsmd/atcmd.c	(working copy)
+@@ -370,8 +370,8 @@
+ 	if (g->mlbuf_len)
+ 		g->mlbuf[g->mlbuf_len ++] = '\n';
+ 	DEBUGP("Appending buf to mlbuf\n");
+-	if (len > sizeof(g->mlbuf) - g->mlbuf_len)
+-		len = sizeof(g->mlbuf) - g->mlbuf_len;
++	if (len > MLPARSE_BUF_SIZE - g->mlbuf_len)
++		len = MLPARSE_BUF_SIZE - g->mlbuf_len;
+ 	memcpy(g->mlbuf + g->mlbuf_len, buf, len);
+ 	g->mlbuf_len += len;
+ 
+@@ -470,7 +470,7 @@
+ 			if (cr)
+ 				len = cr - pos->cur;
+ 			else
+-				len = pos->buflen;
++				len = pos->buflen - 1;  /* assuming zero-terminated strings */
+ 			rc = write(fd, pos->cur, len);
+ 			if (rc == 0) {
+ 				gsmd_log(GSMD_ERROR, "write returns 0, aborting\n");
+@@ -480,8 +480,8 @@
+ 					fd, rc);
+ 				return rc;
+ 			}
+-			if (cr && rc == len)
+-				rc ++;	/* Skip the \n */
++			if (!cr || rc == len)
++				rc ++;	/* Skip the \n or \0 */
+ 			pos->buflen -= rc;
+ 			pos->cur += rc;
+ 			write(fd, "\r", 1);
+Index: gsm/src/gsmd/gsmd.c
+===================================================================
+--- gsm/src/gsmd/gsmd.c	(revision 2745)
++++ gsm/src/gsmd/gsmd.c	(working copy)
+@@ -301,6 +301,10 @@
+ {
+ 	INIT_LLIST_HEAD(&g->users);
+ 
++	g->mlbuf = talloc_array(gsmd_tallocs, unsigned char, MLPARSE_BUF_SIZE);
++	if (!g->mlbuf)
++		return -ENOMEM;
++
+ 	return 0;
+ }
+ 
============================================================
--- packages/gsm/libgsmd_svn.bb	6387ca7f099a514f35eed5b601884e71694739b2
+++ packages/gsm/libgsmd_svn.bb	ba98d351988038ba9049d25dc6f82ae76c983ee7
@@ -9,6 +9,7 @@ SRC_URI = "svn://svn.openmoko.org/trunk/
 SRC_URI_OVERRIDES_PACKAGE_ARCH = "1"
 
 SRC_URI = "svn://svn.openmoko.org/trunk/src/target;module=gsm;proto=http \
+           file://fix-mlbuf.patch;patch=1 \
            file://gsmd \
            file://default"
 S = "${WORKDIR}/gsm"
@@ -27,8 +28,17 @@ do_install_append() {
 	install -m 0755 ${WORKDIR}/gsmd ${D}/${sysconfdir}/init.d/
 	install -d ${D}/${sysconfdir}/default
 	install ${WORKDIR}/default ${D}/${sysconfdir}/default/gsmd
+	# band-aid:
+	install -d ${D}${includedir}/common
+	install -m 0644 ${S}/include/common/linux_list.h ${D}${includedir}/common
 }
 
+# band-aid:
+do_stage_append () {
+	install -d ${STAGING_INCDIR}/common
+	install ${S}/include/common/linux_list.h ${STAGING_INCDIR}/common
+}
+
 PACKAGES =+ "${PN}-tools gsmd gsmd-plugins \
              gsmd-plugin-machine-generic gsmd-plugin-machine-tihtc \
              gsmd-plugin-vendor-qc gsmd-plugin-vendor-ti \






More information about the Openembedded-commits mailing list