Bug 761784 (GLUSTER-52) - patch to avoid infinite loop on ARM
Summary: patch to avoid infinite loop on ARM
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: GLUSTER-52
Product: GlusterFS
Classification: Community
Component: scripts
Version: mainline
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Harshavardhana
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-06-24 18:31 UTC by Basavanagowda Kanur
Modified: 2015-03-23 01:03 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Regression: RTNR
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)
patch - 1 (732 bytes, text/plain)
2009-06-24 15:31 UTC, Basavanagowda Kanur
no flags Details
patch - 2 (730 bytes, text/plain)
2009-06-24 15:32 UTC, Basavanagowda Kanur
no flags Details

Description Basavanagowda Kanur 2009-06-24 15:32:02 UTC
Created attachment 23 [details]
sample attachment

Comment 1 Basavanagowda Kanur 2009-06-24 18:31:37 UTC
[Migrated from savannah BTS] - bug 26006 [https://savannah.nongnu.org/bugs/?26006]
Thu 26 Mar 2009 11:16:55 AM GMT, original submission:

Hi,

I had to modify the 'parse_backticks' procedure when building glusterfs-2.0.0rc4 on Linux/ARM because it wasn't properly detecting the EOF so would enter an infinite loop whilst parsing the vol file.

Attached is the patch - it is merely adding a cast to the comparison as both EOF and the return from fgetc are integers, not characters.

I'm not entirely sure why this doesn't affect other platforms, but the patch shouldn't cause any problems elsewhere.
--------------------------------------------------------------------------------
Thu 02 Apr 2009 11:04:43 AM GMT, comment #1 by 	Giorgio Marinelli <gio_>:

It's not the right patch, not the most portable!

Please take a look on `man 3 fgetc`: int fgetc(FILE *stream);

fgetc return an int! not a char :)

On git master branch it was fixed changing `character` type from char to int.

It should be fixed even for execute_cmd function.

More info and examples could be found here: http://www.network-theory.co.uk/docs/gccintro/gccintro_71.html
--------------------------------------------------------------------------------
Thu 02 Apr 2009 11:19:32 AM GMT, comment #2 by 	Anand Avati <avati>:

Thanks for pointing the execute_cmd() case

Comment 2 Amar Tumballi 2009-11-13 16:45:15 UTC
the problem is with fgetc()... Its fixed in git master branch. Please test with latest codebase, and report the bug if any. Closing the bug.


Note You need to log in before you can comment on or make changes to this bug.