Projects
Browse Source     Search     Timeline     Wiki

Changeset 23552

Show
Ignore:
Timestamp:
03/12/08 15:13:32 (9 months ago)
Author:
zarzycki@…
Message:

<rdar://problem/5795967> 64-bit launchd executables

Location:
trunk/launchd/src
Files:
2 modified

Legend:

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

    r23550 r23552  
    12101210{ 
    12111211        const char *const *argv_tmp = argv; 
     1212        char tmp_path[PATH_MAX]; 
    12121213        char auto_label[1000]; 
    12131214        const char *bn = NULL; 
     
    12301231 
    12311232        if (unlikely(label == AUTO_PICK_LEGACY_LABEL)) { 
    1232                 bn = prog ? prog : basename((char *)argv[0]); /* prog for auto labels is kp.kp_kproc.p_comm */ 
     1233                if (prog) { 
     1234                        bn = prog; 
     1235                } else { 
     1236                        strlcpy(tmp_path, argv[0], sizeof(tmp_path)); 
     1237                        bn = basename(tmp_path); /* prog for auto labels is kp.kp_kproc.p_comm */ 
     1238                } 
    12331239                snprintf(auto_label, sizeof(auto_label), "%s.%s", sizeof(void *) == 8 ? "0xdeadbeeffeedface" : "0xbabecafe", bn); 
    12341240                label = auto_label; 
  • trunk/launchd/src/liblaunch.c

    r23551 r23552  
    4040#include <pwd.h> 
    4141#include <assert.h> 
     42 
     43#ifdef __LP64__ 
     44/* workaround: 5723161 */ 
     45#ifndef __DARWIN_ALIGN32 
     46#define __DARWIN_ALIGN32(x)     (((size_t)(x) + 3) & ~3) 
     47#endif 
     48#undef  CMSG_DATA 
     49#define CMSG_DATA(cmsg) \ 
     50        ((uint8_t *)(cmsg) + __DARWIN_ALIGN32(sizeof(struct cmsghdr))) 
     51#undef  CMSG_SPACE 
     52#define CMSG_SPACE(l)   \ 
     53        (__DARWIN_ALIGN32(sizeof(struct cmsghdr)) + __DARWIN_ALIGN32(l)) 
     54#undef  CMSG_LEN 
     55#define CMSG_LEN(l)     \ 
     56        (__DARWIN_ALIGN32(sizeof(struct cmsghdr)) + (l)) 
     57#endif 
    4258 
    4359#include "libbootstrap_public.h" 
     
    120136                        }; 
    121137                }; 
    122                 int fd; 
    123                 mach_port_t mp; 
    124                 int err; 
    125                 long long number; 
    126                 uint32_t boolean; /* We'd use 'bool' but this struct needs to be used under Rosetta, and sizeof(bool) is different between PowerPC and Intel */ 
     138                int64_t fd; 
     139                uint64_t mp; 
     140                uint64_t err; 
     141                int64_t number; 
     142                uint64_t boolean; /* We'd use 'bool' but this struct needs to be used under Rosetta, and sizeof(bool) is different between PowerPC and Intel */ 
    127143                double float_num; 
    128144        };