True, tty is intializes to 0, so if there's a failure, the error message is
something like this
    Couldn't open (null), errno = 6
Instead of something like
    Couldn't open /dev/ttyFoo, errno = 6
I should have written "unused".
--
Scott Romanowski
978-899-5384
IBM
Cubicle BG125C
550 King St.
Littleton, MA 01460


                                                                       
  From:       Garrett Cooper <[email protected]>                      
                                                                       
  To:         Scott Romanowski/Watson/Contr/IBM@IBMUS                  
                                                                       
  Cc:         [email protected]                           
                                                                       
  Date:       04/14/2011 10:30 AM                                      
                                                                       
  Subject:    Re: [LTP] ioctl01.c bug in error message                 
                                                                       





On Thu, Apr 14, 2011 at 7:20 AM, Scott Romanowski <[email protected]>
wrote:
> testcases/kernel/syscalls/ioctl/ioctl01.c has a bug where, if the open()
> fails, the error message it prints uses an uninitialized char * variable
> instead of the one that holds the device. This only affects the error
> message. The solution is to use 'devname' instead of 'tty' in the
> tst_brkm(), and you can also delete the unused variable, 'char *tty;'.

    tty is initialized -- just not the value that you want (0 because
it's in the BSS).
    Please try this patch and let me know how things go.
Thanks,
-Garrett
[attachment "fix-ioctl01.patch" deleted by Scott
Romanowski/Watson/Contr/IBM]

<<inline: graycol.gif>>

<<inline: ecblank.gif>>

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to