Bug 761784 (GLUSTER-52)

Summary: patch to avoid infinite loop on ARM
Product: [Community] GlusterFS Reporter: Basavanagowda Kanur <gowda>
Component: scriptsAssignee: Harshavardhana <fharshav>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: mainlineCC: amarts, anush, cww, gluster-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: RTNR Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
patch - 1
none
patch - 2 none

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.