VirtualBox

Changeset 12919 in vbox for trunk/src/apps/tunctl


Ignore:
Timestamp:
Oct 2, 2008 9:51:55 AM (16 years ago)
Author:
vboxsync
Message:

signed/unsigned

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/apps/tunctl/tunctl.c

    r9548 r12919  
    120120  else {
    121121    /* emulate behaviour prior to TUNSETGROUP */
    122     if(owner == -1 && group == -1) {
     122    if(owner == (uid_t)-1 && group == (gid_t)-1) {
    123123      owner = geteuid();
    124124    }
    125125
    126     if(owner != -1) {
     126    if(owner != (uid_t)-1) {
    127127      if(ioctl(tap_fd, TUNSETOWNER, owner) < 0){
    128128        perror("TUNSETOWNER");
     
    130130      }
    131131    }
    132     if(group != -1) {
     132    if(group != (gid_t)-1) {
    133133      if(ioctl(tap_fd, TUNSETGROUP, group) < 0){
    134134        perror("TUNSETGROUP");
     
    146146    else {
    147147      printf("Set '%s' persistent and owned by", ifr.ifr_name);
    148       if(owner != -1)
     148      if(owner != (uid_t)-1)
    149149          printf(" uid %d", owner);
    150       if(group != -1)
     150      if(group != (gid_t)-1)
    151151          printf(" gid %d", group);
    152152      printf("\n");
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette