Ignore:
Timestamp:
Sep 2, 2008, 11:50:04 PM (17 years ago)
Author:
bird
Message:

kmk: Made chmod build on windows. Some cleanup of the bsdisms.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/kmkbuiltin/setmode.c

    r616 r1710  
    5555#else
    5656#include "mscfakes.h"
    57 #endif 
     57#endif
    5858
    5959#ifdef SETMODE_DEBUG
     
    8989#ifndef _DIAGASSERT
    9090# define _DIAGASSERT assert
    91 #endif 
     91#endif
    9292
    9393#ifndef S_ISTXT
     
    106106 */
    107107mode_t
    108 getmode(bbox, omode)
     108bsd_getmode(bbox, omode)
    109109        const void *bbox;
    110110        mode_t omode;
     
    196196
    197197void *
    198 setmode(p)
     198bsd_setmode(p)
    199199        const char *p;
    200200{
     
    221221        sigfillset(&signset);
    222222        (void)sigprocmask(SIG_BLOCK, &signset, &sigoset);
    223 #endif 
     223#endif
    224224        (void)umask(mask = umask(0));
    225225        mask = ~mask;
     
    229229
    230230        setlen = SET_LEN + 2;
    231        
     231
    232232        if ((set = malloc((u_int)(sizeof(BITCMD) * setlen))) == NULL)
    233233                return (NULL);
     
    290290                        case 's':
    291291                                /*
    292                                  * If specific bits where requested and 
    293                                  * only "other" bits ignore set-id. 
     292                                 * If specific bits where requested and
     293                                 * only "other" bits ignore set-id.
    294294                                 */
    295295                                if (who == 0 || (who & ~S_IRWXO))
     
    298298                        case 't':
    299299                                /*
    300                                  * If specific bits where requested and 
    301                                  * only "other" bits ignore set-id. 
     300                                 * If specific bits where requested and
     301                                 * only "other" bits ignore set-id.
    302302                                 */
    303303                                if (who == 0 || (who & ~S_IRWXO)) {
     
    412412                        set->bits = mask;
    413413                }
    414        
     414
    415415                if (oparg == '+')
    416416                        set->cmd2 |= CMD2_SET;
     
    446446 * Given an array of bitcmd structures, compress by compacting consecutive
    447447 * '+', '-' 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 
     448 * 'g' and 'o' commands continue to be separate.  They could probably be
    449449 * compacted, but it's not worth the effort.
    450450 */
Note: See TracChangeset for help on using the changeset viewer.