Merge branch 'master' of git://git.lttng.org/lttng-tools
authorDavid Goulet <dgoulet@efficios.com>
Fri, 2 Mar 2012 20:00:16 +0000 (15:00 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 2 Mar 2012 20:00:16 +0000 (15:00 -0500)
1  2 
src/bin/lttng-sessiond/main.c
src/bin/lttng-sessiond/shm.c
src/common/compat/poll.h
src/common/consumer.c
src/common/error.h
src/common/runas.c
src/common/sessiond-comm/sessiond-comm.c
src/common/ust-consumer/ust-consumer.c

Simple merge
index 55d00e67fdd1cf443ac82c4160be3a003d6f0b18,ce1844fe887e654c26847e0842759485fced349f..432d07ecea5eb4462d36a6a4727737532e97791f
@@@ -104,15 -104,11 +104,15 @@@ static int get_wait_shm(char *shm_path
                exit(EXIT_FAILURE);
        }
  
 +#ifndef __FreeBSD__
        ret = fchmod(wait_shm_fd, mode);
        if (ret < 0) {
-               perror("fchmod");
+               PERROR("fchmod");
                exit(EXIT_FAILURE);
        }
 +#else
 +#warning "FreeBSD does not support setting file mode on shm FD. Remember that for secure use, lttng-sessiond should be started before applications linked on lttng-ust."
 +#endif
  
        DBG("Got the wait shm fd %d", wait_shm_fd);
  
Simple merge
Simple merge
index 14b5e7c67ea1eda8f519f2cfe42a48cd32a3a7ca,93c947c0d92ce79cf88b6aa7952762b2e35ff85f..e5255e4a42adaf9479c412679f812cd8064fa47b
@@@ -75,22 -80,9 +80,23 @@@ extern int opt_verbose
                " [in %s() at " __FILE__ ":" XSTR(__LINE__) "]\n", ## args, __func__)
  
  #define _PERROR(fmt, args...) \
-       __lttng_print(PRINT_ERR, "perror " fmt "\n", ## args)
+       __lttng_print(PRINT_ERR, "PERROR: " fmt \
+               " [in %s() at " __FILE__ ":" XSTR(__LINE__) "]\n", ## args, __func__)
  
 +#if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE))
 +/*
 + * Version using XSI strerror_r.
 + */
 +#define PERROR(call, args...) \
 +      do { \
 +              char buf[200]; \
 +              strerror_r(errno, buf, sizeof(buf)); \
 +              _PERROR(call ": %s", ## args, buf); \
 +      } while(0);
 +#else
 +/*
 + * Version using GNU strerror_r, for linux with appropriate defines.
 + */
  #define PERROR(call, args...) \
        do { \
                char *buf; \
index 4742a792eca105f35f1a8e2d194db9aeecd55a66,60e02a2bf85a4e22ff363d2a6ede3cfc1a0fd277..e0c317c4e40347fb7001b74fb9900e9bcfafe32f
@@@ -238,10 -225,10 +238,10 @@@ int run_as_clone(int (*cmd)(void *data)
        run_as_data.retval_pipe = retval_pipe[1];       /* write end */
        child_stack = mmap(NULL, RUNAS_CHILD_STACK_SIZE,
                PROT_WRITE | PROT_READ,
 -              MAP_PRIVATE | MAP_GROWSDOWN | MAP_ANONYMOUS | MAP_STACK,
 +              MAP_PRIVATE | MAP_GROWSDOWN | MAP_ANONYMOUS | LTTNG_MAP_STACK,
                -1, 0);
        if (child_stack == MAP_FAILED) {
-               perror("mmap");
+               PERROR("mmap");
                retval.i = -ENOMEM;
                goto close_pipe;
        }
         * Pointing to the middle of the stack to support architectures
         * where the stack grows up (HPPA).
         */
 -      pid = clone(child_run_as, child_stack + (RUNAS_CHILD_STACK_SIZE / 2),
 -              CLONE_FILES | SIGCHLD,
 -              &run_as_data, NULL);
 +      pid = lttng_clone_files(child_run_as, child_stack + (RUNAS_CHILD_STACK_SIZE / 2),
 +              &run_as_data);
        if (pid < 0) {
-               perror("clone");
+               PERROR("clone");
                retval.i = pid;
                goto unmap_stack;
        }
index 3b224c6ff76e7414c7e140b955bdb27c16d60e8e,8a5ff1d3f10520efb26bef784dc7847fd7fba033..aa24e82ddff31d80f6d0d15fe969aca8dc80f49e
@@@ -568,15 -553,8 +574,15 @@@ int lttcomm_setsockopt_creds_unix_sock(
        /* Set socket for credentials retrieval */
        ret = setsockopt(sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on));
        if (ret < 0) {
-               perror("setsockopt creds unix sock");
+               PERROR("setsockopt creds unix sock");
        }
 -
        return ret;
  }
 +#elif defined(__FreeBSD__)
 +int lttcomm_setsockopt_creds_unix_sock(int sock)
 +{
 +      return 0;
 +}
 +#else
 +#error "Please implement credential support for your OS."
 +#endif /* __linux__ */
This page took 0.032508 seconds and 4 git commands to generate.