Ignore:
Timestamp:
Oct 8, 2007, 1:15:00 AM (18 years ago)
Author:
bird
Message:

more cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/setmode.c

    r1218 r1221  
    5151#include <signal.h>
    5252#include <stdlib.h>
    53 #ifndef _MSC_VER
    54 #include <unistd.h>
    55 #else
    56 #include "mscfakes.h"
    57 #endif
     53#include "shinstance.h" /* for unistd.h types/defines */
    5854
    5955#ifdef SETMODE_DEBUG
     
    8985#ifndef _DIAGASSERT
    9086# define _DIAGASSERT assert
    91 #endif 
     87#endif
    9288
    9389#ifndef S_ISTXT
     
    106102 */
    107103mode_t
    108 getmode(bbox, omode)
    109         const void *bbox;
    110         mode_t omode;
     104bsd_getmode(const void *bbox, mode_t omode)
    111105{
    112106        const BITCMD *set;
     
    196190
    197191void *
    198 setmode(p)
    199         const char *p;
     192bsd_setmode(const char *p)
    200193{
    201194        int perm, who;
     
    221214        sigfillset(&signset);
    222215        (void)sigprocmask(SIG_BLOCK, &signset, &sigoset);
    223 #endif 
     216#endif
    224217        (void)umask(mask = umask(0));
    225218        mask = ~mask;
     
    229222
    230223        setlen = SET_LEN + 2;
    231        
     224
    232225        if ((set = malloc((u_int)(sizeof(BITCMD) * setlen))) == NULL)
    233226                return (NULL);
     
    290283                        case 's':
    291284                                /*
    292                                  * If specific bits where requested and 
    293                                  * only "other" bits ignore set-id. 
     285                                 * If specific bits where requested and
     286                                 * only "other" bits ignore set-id.
    294287                                 */
    295288                                if (who == 0 || (who & ~S_IRWXO))
     
    298291                        case 't':
    299292                                /*
    300                                  * If specific bits where requested and 
    301                                  * only "other" bits ignore set-id. 
     293                                 * If specific bits where requested and
     294                                 * only "other" bits ignore set-id.
    302295                                 */
    303296                                if (who == 0 || (who & ~S_IRWXO)) {
     
    412405                        set->bits = mask;
    413406                }
    414        
     407
    415408                if (oparg == '+')
    416409                        set->cmd2 |= CMD2_SET;
     
    446439 * Given an array of bitcmd structures, compress by compacting consecutive
    447440 * '+', '-' and 'X' commands into at most 3 commands, one of each.  The 'u',
    448  * 'g' and 'o' commands continue to be separate.  They could probably be 
     441 * 'g' and 'o' commands continue to be separate.  They could probably be
    449442 * compacted, but it's not worth the effort.
    450443 */
Note: See TracChangeset for help on using the changeset viewer.