Platform bug using getstream on ARM

Florian Lohoff f at zz.de
Tue Jan 26 15:05:13 CET 2010


On Tue, Jan 26, 2010 at 12:10:07PM +0100, Vojtech Horky wrote:
> Hi,
> 2010/1/25 Stuart Hopkins <stuart at linux-depot.com>:
> > Hi,
> >  I've used getstream on x86 platforms for a few years now and have found it
> > reliable and fast, and to that end have just been trying to use it on my
> > Sheevaplug (ARM v5 compatible). I ran into a problem however where no matter
> > what arguments were passed it would error by just showing the options
> > list...
> >
> > It seems that the command line parsing is broken on ARM, and im not sure if
> > its with a library or the check, but if you change below to getstream.c
> > (line 114):
> >
> > while((ch=getopt(argc, argv, "c:dt:")) != -1) {
> >
> > to
> >
> > while((ch=getopt(argc, argv, "c:dt:")) != 255) {
> >
> > it then works correctly and streams data fine. On my little plug PC it uses
> > around 2% when processing all channels on a single DVB mux.
> >
> > Any chance the code can be adjusted/edited to compensate for the check
> > condition, unless 255 doesn't work on x86?
> According to manual, getopt returns int and -1 in case of error.
> However, in the source, ch is char and thus some automatic
> type-casting happens and the problem is probably caused by different
> char signedness. IMHO the correct solution is to declare ch as int and
> leave the rest as is.

This bug should show up on all unsigned char architectures - IIRC
at least s390 should have the same issue (Although s390 doesnt have a
DVB Card)

I committed this to the git.

--- a/getstream.c
+++ b/getstream.c
@@ -106,7 +106,7 @@ struct http_server  *hserver;

 int main(int argc, char **argv) {
        extern char             *optarg;
-       char                    ch;
+       int                     ch;
        int                     timeout=0;
        GList                   *al;
        struct config_s         *config=NULL;

Flo
-- 
Florian Lohoff                                                 f at zz.de
"Es ist ein grobes Missverständnis und eine Fehlwahrnehmung, dem Staat
im Internet Zensur- und Überwachungsabsichten zu unterstellen."
- - Bundesminister Dr. Wolfgang Schäuble -- 10. Juli in Berlin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: Digital signature
URL: <http://gt.owl.de/pipermail/getstream/attachments/20100126/46b714b3/attachment.pgp>


More information about the Getstream mailing list