Projects
Browse Source     Search     Timeline     Wiki

Changeset 23378

Show
Ignore:
Timestamp:
09/13/07 10:16:54 (15 months ago)
Author:
zarzycki@…
Message:

White space clean up.

Location:
trunk/launchd/src
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/launchd/src/launchctl.c

    r23348 r23378  
    8282#define MACHINIT_JOBKEY_SERVICEPORT     "ServicePort" 
    8383 
    84 #define assumes(e)      \ 
    85                 (__builtin_expect(!(e), 0) ? _log_launchctl_bug(__rcs_file_version__, __FILE__, __LINE__, #e), false : true) 
     84#define assumes(e)      \ 
     85        (__builtin_expect(!(e), 0) ? _log_launchctl_bug(__rcs_file_version__, __FILE__, __LINE__, #e), false : true) 
    8686 
    8787 
     
    739739 
    740740        if (!(S_ISREG(sb.st_mode) || S_ISDIR(sb.st_mode))) { 
    741                 fprintf(stderr, "%s: Dubious path. Not a regular file or directory (skipping):  %s\n", getprogname(), path); 
     741                fprintf(stderr, "%s: Dubious path. Not a regular file or directory (skipping): %s\n", getprogname(), path); 
    742742                return false; 
    743743        } 
     
    895895                } 
    896896 
    897                 if (passive) {                   
     897                if (passive) { 
    898898                        if (unlink(sun.sun_path) == -1 && errno != ENOENT) { 
    899                                 close(sfd);      
     899                                close(sfd); 
    900900                                return; 
    901901                        } 
     
    16221622load_and_unload_cmd(int argc, char *const argv[]) 
    16231623{ 
    1624         NSSearchPathEnumerationState es = 0; 
     1624        NSSearchPathEnumerationState es = 0; 
    16251625        char nspath[PATH_MAX * 2]; /* safe side, we need to append */ 
    16261626        bool badopts = false; 
     
    25962596{ 
    25972597        bool has_servicename = launch_data_dict_lookup(obj, MACHINIT_JOBKEY_SERVICENAME); 
    2598         bool has_command  = launch_data_dict_lookup(obj, MACHINIT_JOBKEY_COMMAND); 
     2598        bool has_command = launch_data_dict_lookup(obj, MACHINIT_JOBKEY_COMMAND); 
    25992599        bool has_label = launch_data_dict_lookup(obj, LAUNCH_JOBKEY_LABEL); 
    26002600 
  • trunk/launchd/src/launchd.c

    r23356 r23378  
    116116        while ((ch = getopt(argc, argv, "s")) != -1) { 
    117117                switch (ch) { 
    118                 case 's': sflag = true;   break;        /* single user */ 
     118                case 's': sflag = true; break;  /* single user */ 
    119119                case '?': /* we should do something with the global optopt variable here */ 
    120120                default: 
  • trunk/launchd/src/launchd_core_logic.c

    r23377 r23378  
    274274}; 
    275275 
    276 #define jobmgr_assumes(jm, e)      \ 
    277                         (__builtin_expect(!(e), 0) ? jobmgr_log_bug(jm, __rcs_file_version__, __FILE__, __LINE__, #e), false : true) 
     276#define jobmgr_assumes(jm, e)   \ 
     277        (__builtin_expect(!(e), 0) ? jobmgr_log_bug(jm, __rcs_file_version__, __FILE__, __LINE__, #e), false : true) 
    278278 
    279279static jobmgr_t jobmgr_new(jobmgr_t jm, mach_port_t requestorport, mach_port_t transfer_port, bool sflag, const char *name); 
     
    370370 
    371371 
    372 #define job_assumes(j, e)      \ 
    373                         (__builtin_expect(!(e), 0) ? job_log_bug(j, __rcs_file_version__, __FILE__, __LINE__, #e), false : true) 
     372#define job_assumes(j, e)       \ 
     373        (__builtin_expect(!(e), 0) ? job_log_bug(j, __rcs_file_version__, __FILE__, __LINE__, #e), false : true) 
    374374 
    375375static void job_import_keys(launch_data_t obj, const char *key, void *context); 
     
    422422        int val; 
    423423} launchd_keys2limits[] = { 
    424         { LAUNCH_JOBKEY_RESOURCELIMIT_CORE,    RLIMIT_CORE    }, 
    425         { LAUNCH_JOBKEY_RESOURCELIMIT_CPU,     RLIMIT_CPU     }, 
    426         { LAUNCH_JOBKEY_RESOURCELIMIT_DATA,    RLIMIT_DATA    }, 
    427         { LAUNCH_JOBKEY_RESOURCELIMIT_FSIZE,   RLIMIT_FSIZE   }, 
    428         { LAUNCH_JOBKEY_RESOURCELIMIT_MEMLOCK, RLIMIT_MEMLOCK }, 
    429         { LAUNCH_JOBKEY_RESOURCELIMIT_NOFILE,  RLIMIT_NOFILE  }, 
    430         { LAUNCH_JOBKEY_RESOURCELIMIT_NPROC,   RLIMIT_NPROC   }, 
    431         { LAUNCH_JOBKEY_RESOURCELIMIT_RSS,     RLIMIT_RSS     }, 
    432         { LAUNCH_JOBKEY_RESOURCELIMIT_STACK,   RLIMIT_STACK   }, 
     424        { LAUNCH_JOBKEY_RESOURCELIMIT_CORE,     RLIMIT_CORE     }, 
     425        { LAUNCH_JOBKEY_RESOURCELIMIT_CPU,      RLIMIT_CPU      }, 
     426        { LAUNCH_JOBKEY_RESOURCELIMIT_DATA,     RLIMIT_DATA     }, 
     427        { LAUNCH_JOBKEY_RESOURCELIMIT_FSIZE,    RLIMIT_FSIZE    }, 
     428        { LAUNCH_JOBKEY_RESOURCELIMIT_MEMLOCK,  RLIMIT_MEMLOCK  }, 
     429        { LAUNCH_JOBKEY_RESOURCELIMIT_NOFILE,   RLIMIT_NOFILE   }, 
     430        { LAUNCH_JOBKEY_RESOURCELIMIT_NPROC,    RLIMIT_NPROC    }, 
     431        { LAUNCH_JOBKEY_RESOURCELIMIT_RSS,      RLIMIT_RSS      }, 
     432        { LAUNCH_JOBKEY_RESOURCELIMIT_STACK,    RLIMIT_STACK    }, 
    433433}; 
    434434 
     
    717717                jobmgr_log(jm, LOG_DEBUG, "About to call: reboot(%s)", reboot_flags_to_C_names(jm->reboot_flags)); 
    718718                runtime_closelog(); 
    719                 jobmgr_assumes(jm,  reboot(jm->reboot_flags) != -1); 
     719                jobmgr_assumes(jm, reboot(jm->reboot_flags) != -1); 
    720720                runtime_closelog(); 
    721721        } else { 
     
    30713071} 
    30723072 
    3073 void     
     3073void 
    30743074semaphoreitem_ignore(job_t j, struct semaphoreitem *si) 
    3075 {        
     3075{ 
    30763076        if (si->fd != -1) { 
    30773077                job_log(j, LOG_DEBUG, "Ignoring Vnode: %d", si->fd); 
     
    43374337} 
    43384338 
    4339 #define NELEM(x)                (sizeof(x)/sizeof(x[0])) 
    4340 #define END_OF(x)               (&(x)[NELEM(x)]) 
     4339#define NELEM(x)        (sizeof(x)/sizeof(x[0])) 
     4340#define END_OF(x)       (&(x)[NELEM(x)]) 
    43414341 
    43424342char ** 
     
    47384738        } 
    47394739 
    4740         if (mon < wtm->tm_mon) { 
     4740        if (mon < wtm->tm_mon) { 
    47414741                return false; 
    47424742        } 
    47434743 
    4744         if (mon > wtm->tm_mon) { 
     4744        if (mon > wtm->tm_mon) { 
    47454745                wtm->tm_mon = mon; 
    47464746                wtm->tm_mday = 1; 
     
    47734773        } 
    47744774 
    4775         if (mday < wtm->tm_mday) { 
     4775        if (mday < wtm->tm_mday) { 
    47764776                return false; 
    47774777        } 
    47784778 
    4779         if (mday > wtm->tm_mday) { 
     4779        if (mday > wtm->tm_mday) { 
    47804780                wtm->tm_mday = mday; 
    47814781                wtm->tm_hour = 0; 
  • trunk/launchd/src/launchd_runtime.c

    r23376 r23378  
    143143        pthread_attr_destroy(&attr); 
    144144 
    145         pthread_attr_init(&attr); 
     145        pthread_attr_init(&attr); 
    146146        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); 
    147147        pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN); 
     
    11741174        struct logmsg_s *lm; 
    11751175 
    1176 #define ROUND_TO_64BIT_WORD_SIZE(x)     ((x + 7) & ~7) 
     1176#define ROUND_TO_64BIT_WORD_SIZE(x)     ((x + 7) & ~7) 
    11771177 
    11781178        /* we do this to make the unpacking for the log_drain cause unalignment faults */ 
  • trunk/launchd/src/launchproxy.c

    r20793 r23378  
    4949static void find_fds(launch_data_t o, const char *key __attribute__((unused)), void *context __attribute__((unused))) 
    5050{ 
    51         struct kevent kev; 
    52         size_t i; 
     51        struct kevent kev; 
     52        size_t i; 
    5353        int fd; 
    5454 
    55         switch (launch_data_get_type(o)) { 
    56         case LAUNCH_DATA_FD: 
     55        switch (launch_data_get_type(o)) { 
     56        case LAUNCH_DATA_FD: 
    5757                fd = launch_data_get_fd(o); 
    5858                if (-1 == fd) 
     
    6262                if (kevent(kq, &kev, 1, NULL, 0, NULL) == -1) 
    6363                        syslog(LOG_DEBUG, "kevent(%d): %m", fd); 
    64                 break; 
    65         case LAUNCH_DATA_ARRAY: 
    66                 for (i = 0; i < launch_data_array_get_count(o); i++) 
    67                         find_fds(launch_data_array_get_index(o, i), NULL, NULL); 
    68                 break; 
    69         case LAUNCH_DATA_DICTIONARY: 
    70                 launch_data_dict_iterate(o, find_fds, NULL); 
    71                 break; 
    72         default: 
    73                 break; 
    74         } 
     64                break; 
     65        case LAUNCH_DATA_ARRAY: 
     66                for (i = 0; i < launch_data_array_get_count(o); i++) 
     67                        find_fds(launch_data_array_get_index(o, i), NULL, NULL); 
     68                break; 
     69        case LAUNCH_DATA_DICTIONARY: 
     70                launch_data_dict_iterate(o, find_fds, NULL); 
     71                break; 
     72        default: 
     73                break; 
     74        } 
    7575} 
    7676 
  • trunk/launchd/src/liblaunch.c

    r23274 r23378  
    373373{ 
    374374        launch_data_t r = NULL; 
    375         
     375 
    376376        if (where->_array_cnt > 0) { 
    377377                r = where->_array[0]; 
     
    526526launchd_fdopen(int fd) 
    527527{ 
    528         launch_t c; 
    529  
    530         c = calloc(1, sizeof(struct _launch)); 
     528        launch_t c; 
     529 
     530        c = calloc(1, sizeof(struct _launch)); 
    531531        if (!c) 
    532532                return NULL; 
    533533 
    534         c->fd = fd; 
     534        c->fd = fd; 
    535535 
    536536        fcntl(fd, F_SETFL, O_NONBLOCK); 
    537537 
    538         if ((c->sendbuf = malloc(0)) == NULL) 
     538        if ((c->sendbuf = malloc(0)) == NULL) 
    539539                goto out_bad; 
    540         if ((c->sendfds = malloc(0)) == NULL) 
     540        if ((c->sendfds = malloc(0)) == NULL) 
    541541                goto out_bad; 
    542         if ((c->recvbuf = malloc(0)) == NULL) 
     542        if ((c->recvbuf = malloc(0)) == NULL) 
    543543                goto out_bad; 
    544         if ((c->recvfds = malloc(0)) == NULL) 
     544        if ((c->recvfds = malloc(0)) == NULL) 
    545545                goto out_bad; 
    546546 
     
    771771                iov[0].iov_len = sizeof(lmh); 
    772772                mh.msg_iov = iov; 
    773                 mh.msg_iovlen = 2; 
     773                mh.msg_iovlen = 2; 
    774774        } else { 
    775775                mh.msg_iov = iov + 1; 
    776                 mh.msg_iovlen = 1; 
     776                mh.msg_iovlen = 1; 
    777777        } 
    778778 
     
    917917                } while (launchd_msg_send(_lc->l, NULL) == -1); 
    918918        } 
    919         
     919 
    920920        while (resp == NULL) { 
    921921                if (d == NULL && launch_data_array_get_count(_lc->async_resp) > 0) { 
     
    951951        launch_data_t rmsg = NULL; 
    952952        size_t data_offset, fd_offset; 
    953         struct msghdr mh; 
    954         struct iovec iov; 
     953        struct msghdr mh; 
     954        struct iovec iov; 
    955955        int r; 
    956956 
    957         memset(&mh, 0, sizeof(mh)); 
    958         mh.msg_iov = &iov; 
    959         mh.msg_iovlen = 1; 
     957        memset(&mh, 0, sizeof(mh)); 
     958        mh.msg_iov = &iov; 
     959        mh.msg_iovlen = 1; 
    960960 
    961961        lh->recvbuf = reallocf(lh->recvbuf, lh->recvlen + 8*1024); 
     
    11001100 
    11011101        if (r) 
    1102                launch_data_set_errno(r, e); 
     1102                launch_data_set_errno(r, e); 
    11031103 
    11041104        return r; 
     
    11101110 
    11111111        if (r) 
    1112                launch_data_set_fd(r, fd); 
     1112                launch_data_set_fd(r, fd); 
    11131113 
    11141114        return r; 
     
    11201120 
    11211121        if (r) 
    1122                launch_data_set_machport(r, p); 
     1122                launch_data_set_machport(r, p); 
    11231123 
    11241124        return r;