[Bug 2123] New: Call to uname should not check for return == 0

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Dec 20 19:12:28 PST 2004


Please do not reply to this email: if you want to comment on the bug, go to          
the URL shown below and enter yourcomments there.   
 
https://bugs.freedesktop.org/show_bug.cgi?id=2123        
   
           Summary: Call to uname should not check for return == 0
           Product: xorg
           Version: CVS_head
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P3
         Component: Server/general
        AssignedTo: xorg-bugzilla-noise at freedesktop.org
        ReportedBy: alan.coopersmith at sun.com


xf86Init.c contains this code to print the current OS rev in the Xorg.0.log:

    if (uname(&name) == 0) {
      ErrorF("Current Operating System: %s %s %s %s %s\n",
	name.sysname, name.nodename, name.release, name.version, name.machine);
    }

This line never appears in the log on Solaris - investigation shows that uname
is returning 1.    While the Linux & FreeBSD man pages indicate that 0 indicates
success,
and a negative number is an error, other systems only state that non-negative is
success and negative is an error.   (This includes the Solaris, Irix, & HP-UX
man pages and the uname entry in the SUSv3 spec.)

This should therefore be changed to >= 0 for compatibility with these other
OS'es while maintaining BSD compatibility.        
   
   
--         
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email       
   
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the xorg-bugzilla-noise mailing list