Changeset 5160:efd742a8d396 in roaraudio


Ignore:
Timestamp:
10/16/11 16:05:08 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

corrected pointer checks to conform coding style

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/roard.c

    r5146 r5160  
    24182418   ROAR_ERR("Can not clear supplementary group IDs: %s", strerror(errno)); 
    24192419  } 
    2420   if ( !grp || setgid(grp->gr_gid) == -1 ) { 
     2420  if ( grp == NULL || setgid(grp->gr_gid) == -1 ) { 
    24212421   ROAR_ERR("Can not set GroupID: %s", strerror(errno)); 
    24222422  } 
     
    24982498  } 
    24992499#if defined(ROAR_HAVE_SETGID) && defined(ROAR_HAVE_SETUID) && defined(ROAR_HAVE_IO_POSIX) 
    2500   if ( pwd || grp ) { 
    2501    if ( chown(pidfile, pwd ? pwd->pw_uid : -1, grp ? grp->gr_gid : -1) == -1 ) { 
     2500  if ( pwd != NULL || grp != NULL ) { 
     2501   if ( chown(pidfile, pwd != NULL ? pwd->pw_uid : -1, grp != NULL ? grp->gr_gid : -1) == -1 ) { 
    25022502    ROAR_WARN("Can not change ownership of pidfile: %s: %s", pidfile, strerror(errno)); 
    25032503   } 
     
    25292529   return 1; 
    25302530  } 
    2531   if ( !pwd || setuid(pwd->pw_uid) == -1 ) { 
     2531  if ( pwd == NULL || setuid(pwd->pw_uid) == -1 ) { 
    25322532   ROAR_ERR("Can not set UserID: %s", strerror(errno)); 
    25332533   return 3; 
Note: See TracChangeset for help on using the changeset viewer.