Bug 464760 - NM uses obsoleted "struct termio"
NM uses obsoleted "struct termio"
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: NetworkManager (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Dan Williams
Fedora Extras Quality Assurance
: EasyFix, Patch
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-30 06:53 EDT by Oliver Falk
Modified: 2009-04-17 10:01 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-04-09 16:24:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
cvs diff to the specfile - needs to be adopted of course (1.45 KB, patch)
2008-09-30 06:53 EDT, Oliver Falk
no flags Details | Diff
Simple patch to use "struct termios" instead of (obsoleted) "struct termio" in nm-serial-device.c (545 bytes, patch)
2008-09-30 06:55 EDT, Oliver Falk
no flags Details | Diff

  None (edit)
Description Oliver Falk 2008-09-30 06:53:34 EDT
Created attachment 318056 [details]
cvs diff to the specfile - needs to be adopted of course

While trying to compile NM-1:0.7.0-0.11.svn4022.2 on alpha, I ran into a compile error:

"""
nm-serial-device.c: In function 'nm_serial_device_open':
nm-serial-device.c:348: error: array subscript is above array bounds
nm-serial-device.c:349: error: array subscript is above array bounds
"""

After analysing the problem, I found out that stdbuf is defined as "struct termio". Take a look at termio.h:
"""
[oliver@kriek ~]$ cat /usr/include/termio.h 
/* Compatible <termio.h> for old `struct termio' ioctl interface.
   This is obsolete; use the POSIX.1 `struct termios' interface
   defined in <termios.h> instead.  */

#include <termios.h>
#include <sys/ioctl.h>
"""

A simple fix - at least for alpha - is to use "struct termios" instead (I'll include a patch!). However, I have not tested this on x86 or any other platform - this is up to you! :-)
Comment 1 Oliver Falk 2008-09-30 06:55:44 EDT
Created attachment 318057 [details]
Simple patch to use "struct termios" instead of (obsoleted) "struct termio"  in nm-serial-device.c

This needs to be tested on x86(_64), ppc and sparc... I don't know if it will work there as well.
Comment 2 Oliver Falk 2008-11-18 04:57:33 EST
ping :-)
Comment 3 Niels Haase 2009-04-09 16:24:46 EDT
Thanks for the patch. But if you make changes to NetworkManager, create the patch using a Unified diff format (ie, diff -u) and mail the patch to the NetworkManager list (networkmanager-list@gnome.org). Thanks

-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers
Comment 4 Oliver Falk 2009-04-16 03:26:21 EDT
Oh great. For this answer I had to way half a year :-/
Comment 5 Dan Williams 2009-04-17 10:01:46 EDT
Upstream commit 31a34fa7ffbceb79d5e6c16158e5dcce285dcff1.  Sorry for the lag...

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